Table of Contents

Class AddressFamilyConnector

Namespace
VpnHood.Net.Toolkit.Net
Assembly
VpnHood.Net.Toolkit.dll

Provides a TCP connection over one address family, whatever the OS prefers, for an HTTP handler's ConnectCallback, so the web service sees the caller's address of that family.

public static class AddressFamilyConnector
Inheritance
AddressFamilyConnector
Inherited Members

Methods

Connect(DnsEndPoint, AddressFamily, CancellationToken)

Connects to a host over an address family.

public static ValueTask<Stream> Connect(DnsEndPoint endPoint, AddressFamily addressFamily, CancellationToken cancellationToken)

Parameters

endPoint DnsEndPoint

The host and port.

addressFamily AddressFamily

The address family.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<Stream>

A task whose result is a stream that owns the connection's socket.

Exceptions

SocketException

The connection failed, as when the host has no address of the family.

OperationCanceledException

cancellationToken was canceled.