Interface IPeerClient<T>
Client for peer communication
public interface IPeerClient<T> : IDisposable where T : struct
Type Parameters
T
- Inherited Members
Methods
ProcessMessages(CancellationToken)
Start receiving messages
Task ProcessMessages(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationToken
Returns
SendTo(SocketAddress, in T, IMessageHandler<T>?, CancellationToken)
Send Message to peer
ValueTask SendTo(SocketAddress peerAddress, in T payload, IMessageHandler<T>? callback = null, CancellationToken cancellationToken = default)
Parameters
peerAddress
SocketAddresspayload
Tcallback
IMessageHandler<T>cancellationToken
CancellationToken
Returns
TrySendTo(SocketAddress, in T, IMessageHandler<T>?)
Try To Send Message to peer
bool TrySendTo(SocketAddress peerAddress, in T payload, IMessageHandler<T>? callback = null)
Parameters
peerAddress
SocketAddresspayload
Tcallback
IMessageHandler<T>