Class Identify1
Identifies the peer.
Implements
Inherited Members
Namespace: PeerTalk.Protocols
Assembly: PeerTalk.dll
Syntax
public class Identify1 : IPeerProtocol
  Properties
| Improve this Doc View SourceName
The name of the protocol.
Declaration
public string Name { get; }
  Property Value
| Type | Description | 
|---|---|
| String | 
Version
The version of the protocol.
Declaration
public SemVersion Version { get; }
  Property Value
| Type | Description | 
|---|---|
| Semver.SemVersion | 
Methods
| Improve this Doc View SourceGetRemotePeerAsync(PeerConnection, CancellationToken)
Gets the identity information of the remote peer.
Declaration
public Task<Peer> GetRemotePeerAsync(PeerConnection connection, CancellationToken cancel)
  Parameters
| Type | Name | Description | 
|---|---|---|
| PeerConnection | connection | The currenty connection to the remote peer.  | 
      
| CancellationToken | cancel | 
Returns
| Type | Description | 
|---|---|
| Task<Peer> | 
ProcessMessageAsync(PeerConnection, Stream, CancellationToken)
Process a message for the protocol.
Declaration
public Task ProcessMessageAsync(PeerConnection connection, Stream stream, CancellationToken cancel = default(CancellationToken))
  Parameters
| Type | Name | Description | 
|---|---|---|
| PeerConnection | connection | A connection between two peers.  | 
      
| Stream | stream | The message source.  | 
      
| CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the asynchronous operation.  | 
      
ToString()
Declaration
public override string ToString()
  Returns
| Type | Description | 
|---|---|
| String | 
Overrides
| Improve this Doc View SourceUpdateRemotePeerAsync(Peer, Stream, CancellationToken)
Read the identify message and update the peer information.
Declaration
public Task UpdateRemotePeerAsync(Peer remote, Stream stream, CancellationToken cancel)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Peer | remote | |
| Stream | stream | |
| CancellationToken | cancel | 
Returns
| Type | Description | 
|---|---|
| Task |