Show / Hide Table of Contents

Class MultiplexedListener

Represents multiplexed listener.

Inheritance
object
Disposable
MultiplexedListener
TcpMultiplexedListener
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 MultiplexedListener : Disposable, IDisposable, IAsyncDisposable

Constructors

| Edit this page View Source

MultiplexedListener(Options)

Initializes a new multiplexed listener.

Declaration
protected MultiplexedListener(MultiplexedListener.Options configuration)
Parameters
Type Name Description
MultiplexedListener.Options configuration

Methods

| Edit this page View Source

AcceptAsync(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
OpenStreamAsync(CancellationToken)
DuplexStream
| Edit this page View Source

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

| 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

Listen()

Creates listening socket.

Declaration
protected abstract Socket Listen()
Returns
Type Description
Socket

Listening socket.

| Edit this page View Source

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.

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
☀
☾