Skip to content

Class TcpTransport

Namespace: DotBoxD.Transports.Tcp
Assembly: DotBoxD.Transports.Tcp.dll

TCP client transport implementation.

public sealed class TcpTransport : ITransport, IAsyncDisposable

objectTcpTransport

ITransport, IAsyncDisposable

object.Equals(object), object.Equals(object, object), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object, object), object.ToString()

RpcTransportExtensions.ConnectPeerAsync(ITransport, ISerializer, RpcPeerOptions?, CancellationToken), RpcTransportExtensions.ConnectPeerAsync(ITransport, ISerializer, Action<RpcPeer>, RpcPeerOptions?, CancellationToken)

public TcpTransport(string host, int port)

host string

port int

Gets the active connection (client-side).

public IRpcChannel? Connection { get; }

IRpcChannel?

Idle timeout applied to this connection’s frame reads (slow-loris defense). null uses DotBoxD.Transports.Tcp.TcpConnection.DefaultFrameReadIdleTimeout; System.Threading.Timeout.InfiniteTimeSpan disables it. See DotBoxD.Transports.Tcp.TcpConnection.

public TimeSpan? FrameReadIdleTimeout { get; init; }

TimeSpan?

Gets whether there is an active connection.

public bool IsConnected { get; }

bool

Establishes a connection (client-side).

public Task ConnectAsync(CancellationToken ct = default)

ct CancellationToken

Task

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

ValueTask

A task that represents the asynchronous dispose operation.