WasiInMemoryTcpListener Class

A listener of the host on a WasiInMemoryNetwork, created by WasiInMemoryNetwork.Listen.

public sealed class WasiInMemoryTcpListener : IDisposable
Implements

Properties

NameDescription
LocalEndPointGets the address of the listener, with its port.

Gets the address of the listener, with its port.

public IPEndPoint LocalEndPoint { get; }

Property value

IPEndPoint

Methods

NameDescription
AcceptAsync(CancellationToken)Waits for a connection of a component.
Dispose()Stops listening.

AcceptAsync(CancellationToken)

WasiInMemoryNetwork.cs

Waits for a connection of a component.

net10.0

public ValueTask<Stream> AcceptAsync(CancellationToken cancellationToken = default)

net11.0

public ValueTask<Stream> AcceptAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken
The token to stop waiting.

Returns

ValueTask<Stream> The stream of the connection: dispose it to close the connection.

Exceptions

SocketException
The listener is disposed.

Stops listening.

public void Dispose()