<PackageReference Include="SSH.NET" Version="2026.0.1" />

Renci.SshNet.Abstractions.SocketAbstraction

static class SocketAbstraction
public static Socket Connect(IPEndPoint remoteEndpoint, TimeSpan connectTimeout)

public static void Connect(Socket socket, EndPoint remoteEndpoint, TimeSpan connectTimeout)

public static bool IsErrorResumable(SocketError socketError)

public static byte[] Read(Socket socket, int size, TimeSpan timeout)

Receives data from a bound Socket.

public static int Read(Socket socket, byte[] buffer, int offset, int size, TimeSpan readTimeout)

Receives data from a bound Socket into a receive buffer.

public static ValueTask<int> ReadAsync(Socket socket, byte[] buffer, CancellationToken cancellationToken)

public static int ReadByte(Socket socket, TimeSpan timeout)

Reads a byte from the specified Socket.

public static void ReadContinuous(Socket socket, byte[] buffer, int offset, int size, Action<byte[], int, int> processReceivedBytesAction)

public static void Send(Socket socket, byte[] data)

public static void Send(Socket socket, byte[] data, int offset, int size)

public static ValueTask SendAsync(Socket socket, ReadOnlyMemory<byte> data, CancellationToken cancellationToken = default)

public static void SendByte(Socket socket, byte value)

Sends a byte using the specified Socket.