Proxy |
public virtual Task<Stream> ConnectAsync( string host, int port, int timeout, CancellationToken cancellationToken = default )
Exception | Condition |
---|---|
ArgumentNullException | host is null. |
ArgumentOutOfRangeException | port is not between 1 and 65535. -or- timeout is less than -1. |
ArgumentException | The host is a zero-length string. |
OperationCanceledException | The operation was canceled via the cancellation token. |
TimeoutException | The operation timed out. |
SocketException | A socket error occurred trying to connect to the remote host. |
IOException | An I/O error occurred. |