Interface IPeerProtocol
Defines the messages that can be exchanged between two peers.
Namespace: PeerTalk.Protocols
Assembly: PeerTalk.dll
Syntax
public interface IPeerProtocol
Remarks
ToString() must return a string in the form "/name/version".
Properties
| Improve this Doc View SourceName
The name of the protocol.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String |
Version
The version of the protocol.
Declaration
SemVersion Version { get; }
Property Value
Type | Description |
---|---|
Semver.SemVersion |
Methods
| Improve this Doc View SourceProcessMessageAsync(PeerConnection, Stream, CancellationToken)
Process a message for the protocol.
Declaration
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. |