Class MultiplexedListener
Represents multiplexed listener.
Inherited Members
Namespace: DotNext.Net.Multiplexing
Assembly: DotNext.Net.Cluster.dll
Syntax
public abstract class MultiplexedListener : Disposable, IDisposable, IAsyncDisposable
Constructors
| Edit this page View SourceMultiplexedListener(Options)
Initializes a new multiplexed listener.
Declaration
protected MultiplexedListener(MultiplexedListener.Options configuration)
Parameters
Type | Name | Description |
---|---|---|
MultiplexedListener.Options | configuration |
Methods
| Edit this page View SourceAcceptAsync(CancellationToken)
Accepts the incoming stream asynchronously.
Declaration
public ValueTask<IDuplexPipe> AcceptAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<IDuplexPipe> | The incoming stream. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
ObjectDisposedException | The listener is disposed. |
See Also
| Edit this page View SourceConfigureAcceptedSocket(Socket)
Configures the socket associated with the incoming connection.
Declaration
protected virtual void ConfigureAcceptedSocket(Socket socket)
Parameters
Type | Name | Description |
---|---|---|
Socket | socket | The socket that represents the incoming connection. |
Remarks
By default, this method does nothing.
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.
Listen()
Creates listening socket.
Declaration
protected abstract Socket Listen()
Returns
Type | Description |
---|---|
Socket | Listening socket. |
StartAsync(CancellationToken)
Ensures that the listener is waiting for the incoming connections.
Declaration
public ValueTask StartAsync(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask | The task that resumes when the listener is started listening the socket. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
ObjectDisposedException | The listener is disposed. |