Class TcpClientAdapter
Simple wrapper around Socket.
public class TcpClientAdapter : ITcpClient, IDisposable
- Inheritance
-
TcpClientAdapter
- Implements
- Inherited Members
Constructors
TcpClientAdapter(Socket)
public TcpClientAdapter(Socket socket)
Parameters
socket
Socket
Properties
Client
public virtual Socket Client { get; }
Property Value
Connected
public virtual bool Connected { get; }
Property Value
ReceiveTimeout
public virtual TimeSpan ReceiveTimeout { get; set; }
Property Value
Methods
Close()
public virtual void Close()
ConnectAsync(IPAddress, int, CancellationToken)
public virtual Task ConnectAsync(IPAddress ep, int port, CancellationToken cancellationToken = default)
Parameters
ep
IPAddressport
intcancellationToken
CancellationToken
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
GetMatchingHost(IReadOnlyCollection<IPAddress>, AddressFamily)
public static IPAddress? GetMatchingHost(IReadOnlyCollection<IPAddress> addresses, AddressFamily addressFamily)
Parameters
addresses
IReadOnlyCollection<IPAddress>addressFamily
AddressFamily
Returns
GetStream()
public virtual NetworkStream GetStream()