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
sandboxstringportuintoptionsForwardOptionscancellationTokenCancellationToken
Returns
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
sandboxstringremotePortuintlocalPortintoptionsListenOptionscancellationTokenCancellationToken