Class MultiplexedClient
Represents multiplexed client.
Inherited Members
Namespace: DotNext.Net.Multiplexing
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class MultiplexedClient : Disposable, IDisposable, IAsyncDisposable
Constructors
| Edit this page View SourceMultiplexedClient(Options)
Initializes a new multiplexed client.
Declaration
protected MultiplexedClient(MultiplexedClient.Options configuration)
Parameters
Type | Name | Description |
---|---|---|
MultiplexedClient.Options | configuration | The configuration of the client. |
Methods
| Edit this page View SourceConnectAsync(CancellationToken)
Creates a connected socket.
Declaration
protected abstract ValueTask<Socket> ConnectAsync(CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<Socket> | The connected socket. |
Dispose(bool)
Releases managed and unmanaged resources associated with this object.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true if called from Dispose(); false if called from finalizer ~Disposable(). |
Overrides
| Edit this page View SourceDisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask | A task that represents the asynchronous dispose operation. |
DisposeAsyncCore()
Releases managed resources associated with this object asynchronously.
Declaration
protected override ValueTask DisposeAsyncCore()
Returns
Type | Description |
---|---|
ValueTask | The task representing asynchronous execution of this method. |
Overrides
Remarks
This method makes sense only if derived class implements IAsyncDisposable interface.
OpenStreamAsync(CancellationToken)
Creates a new multiplexed client stream.
Declaration
public ValueTask<IDuplexPipe> OpenStreamAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<IDuplexPipe> | A duplex pipe for data input/output. |
Remarks
If Output is completed successfully, then the implementation doesn't expect the input data and remote Input will be completed successfully as well. If Output is completed with exception, then the implementation doesn't expect the input data, but remote Input will not be completed. If Input is completed (successfully or not), then the implementation skips any incoming packets for the associated stream.
To deactivate the stream, the consumer needs to complete both Input and Output.
Input can be completed successfully if the remote Output completes successfully. Input can be completed with StreamRejectedException if the backlog of the remote peer is full, and the peer cannot accept the incoming stream. TimeoutException if the consumer of Input is not fast enough to consume the incoming traffic. ConnectionResetException if the client or server is disposed.
See Also
| Edit this page View SourceStartAsync(CancellationToken)
Connects to the server and starts the dispatching loop.
Declaration
public ValueTask StartAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token |
Returns
Type | Description |
---|---|
ValueTask | The task that resumes when the client socket is connected successfully to the server. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
ObjectDisposedException | The client is disposed. |