Table of Contents

Interface ITcpClient

Namespace
OpenShell
Assembly
OpenShell.Sdk.dll

TCP forwarding to sandbox ports.

public interface ITcpClient

Methods

ForwardAsync(string, uint, ForwardOptions?, CancellationToken)

Opens a duplex byte stream to a loopback port inside the sandbox.

ValueTask<ForwardStream> ForwardAsync(string sandbox, uint port, ForwardOptions? options = null, CancellationToken cancellationToken = default)

Parameters

sandbox string
port uint
options ForwardOptions
cancellationToken CancellationToken

Returns

ValueTask<ForwardStream>

ListenAsync(string, uint, int, ListenOptions?, CancellationToken)

Listens locally (port 0 picks a free one) and forwards each connection to remotePort. Dispose the result to stop accepting and tear down active connections.

ValueTask<IForwardListener> ListenAsync(string sandbox, uint remotePort, int localPort = 0, ListenOptions? options = null, CancellationToken cancellationToken = default)

Parameters

sandbox string
remotePort uint
localPort int
options ListenOptions
cancellationToken CancellationToken

Returns

ValueTask<IForwardListener>