Interface IPeerSocket
Socket abstraction over peers
public interface IPeerSocket : IDisposable
- Inherited Members
Properties
AddressFamily
AddressFamily AddressFamily { get; }
Property Value
Port
Binding port
int Port { get; }
Property Value
Methods
Close()
void Close()
ReceiveAsync(Memory<byte>, CancellationToken)
Receives data and returns the endpoint of the sending host.
ValueTask<SocketReceiveFromResult> ReceiveAsync(Memory<byte> buffer, CancellationToken cancellationToken)
Parameters
buffer
Memory<byte>cancellationToken
CancellationToken
Returns
ReceiveFromAsync(Memory<byte>, SocketAddress, CancellationToken)
Receive bytes from specified remote host
ValueTask<int> ReceiveFromAsync(Memory<byte> buffer, SocketAddress address, CancellationToken cancellationToken)
Parameters
buffer
Memory<byte>address
SocketAddresscancellationToken
CancellationToken
Returns
SendToAsync(ReadOnlyMemory<byte>, EndPoint, CancellationToken)
Sends data to the specified remote host.
ValueTask<int> SendToAsync(ReadOnlyMemory<byte> buffer, EndPoint remoteEndPoint, CancellationToken cancellationToken)
Parameters
buffer
ReadOnlyMemory<byte>remoteEndPoint
EndPointcancellationToken
CancellationToken
Returns
SendToAsync(ReadOnlyMemory<byte>, SocketAddress, CancellationToken)
Sends data to the specified remote host.
ValueTask<int> SendToAsync(ReadOnlyMemory<byte> buffer, SocketAddress socketAddress, CancellationToken cancellationToken)
Parameters
buffer
ReadOnlyMemory<byte>socketAddress
SocketAddresscancellationToken
CancellationToken