WasiInMemoryTcpListener Class
A listener of the host on a WasiInMemoryNetwork, created by WasiInMemoryNetwork.Listen.
public sealed class WasiInMemoryTcpListener : IDisposable- Implements
Properties
| Name | Description |
|---|---|
| LocalEndPoint | Gets the address of the listener, with its port. |
LocalEndPoint
WasiInMemoryNetwork.csGets the address of the listener, with its port.
public IPEndPoint LocalEndPoint { get; }Property value
Methods
| Name | Description |
|---|---|
| AcceptAsync(CancellationToken) | Waits for a connection of a component. |
| Dispose() | Stops listening. |
AcceptAsync(CancellationToken)
WasiInMemoryNetwork.csWaits 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
cancellationTokenCancellationToken- 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.
Dispose()
WasiInMemoryNetwork.csStops listening.
public void Dispose()