Class TcpListenerDeviceTransport

Namespace
ProtoTest.Devices.Tcp
Assembly
ProtoTest.Devices.Tcp.dll

Listens for the system under test to connect to the device: the test opens a port, hands the address to the application, and the first send or receive waits for the inbound connection. Each device gets its own listener, so parallel tests never share a port.

public sealed class TcpListenerDeviceTransport : IProtoDeviceTransport
Inheritance
TcpListenerDeviceTransport
Implements
Inherited Members
Extension Methods

Constructors

TcpListenerDeviceTransport(TcpDeviceOptions)

Creates the transport with the run's TCP options.

public TcpListenerDeviceTransport(TcpDeviceOptions options)

Parameters

options TcpDeviceOptions

Fields

TransportName

The transport's name, as registrations and the trace refer to it.

public const string TransportName = "TCP listener"

Field Value

string

Properties

Name

Gets the transport's name, as configuration and registrations refer to it.

public string Name { get; }

Property Value

string

Methods

ConnectAsync(DeviceEndpoint, CancellationToken)

Connects to a device endpoint; the connection is opened lazily on first use.

public ValueTask<IProtoDeviceConnection> ConnectAsync(DeviceEndpoint endpoint, CancellationToken cancellationToken = default)

Parameters

endpoint DeviceEndpoint
cancellationToken CancellationToken

Returns

ValueTask<IProtoDeviceConnection>