Show / Hide Table of Contents

Class MultiplexedClient

Represents multiplexed client.

Inheritance
object
Disposable
MultiplexedClient
TcpMultiplexedClient
Implements
IDisposable
IAsyncDisposable
Inherited Members
Disposable.IsDisposed
Disposable.IsDisposing
Disposable.IsDisposingOrDisposed
Disposable.CreateException()
Disposable.DisposedTask
Disposable.GetDisposedTask<T>()
Disposable.TrySetDisposedException<T>(TaskCompletionSource<T>)
Disposable.TrySetDisposedException(TaskCompletionSource)
Disposable.TryBeginDispose()
Disposable.Dispose()
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(IEnumerable<IAsyncDisposable>)
Disposable.Dispose<T>(ReadOnlySpan<T>)
Disposable.DisposeAsync(params IAsyncDisposable[])
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DotNext.Net.Multiplexing
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class MultiplexedClient : Disposable, IDisposable, IAsyncDisposable

Constructors

| Edit this page View Source

MultiplexedClient(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 Source

ConnectAsync(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.

| Edit this page View Source

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
Disposable.Dispose(bool)
| Edit this page View Source

DisposeAsync()

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.

| Edit this page View Source

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
Disposable.DisposeAsyncCore()
Remarks

This method makes sense only if derived class implements IAsyncDisposable interface.

| Edit this page View Source

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
DuplexStream
| Edit this page View Source

StartAsync(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.

Implements

IDisposable
IAsyncDisposable

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾