Table of Contents

Class SystemSocketFactory

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

Provides the system's plain sockets: the base of the platform factories.

public class SystemSocketFactory : ISocketFactory
Inheritance
SystemSocketFactory
Implements
Inherited Members

Methods

CreateTcpClient(IPEndPoint, TcpClientOptions?)

Creates a TCP client for an endpoint's address family, not connected yet.

public virtual TcpClient CreateTcpClient(IPEndPoint ipEndPoint, TcpClientOptions? options = null)

Parameters

ipEndPoint IPEndPoint

The endpoint the client will connect to; its address family is the client's.

options TcpClientOptions

The client's options, or null for the defaults.

Returns

TcpClient

The TCP client, which the caller owns and disposes.

Remarks

It sets each kernel buffer size the options give that is above zero.

CreateUdpClient(AddressFamily)

Creates a UDP client of an address family.

public virtual UdpClient CreateUdpClient(AddressFamily addressFamily)

Parameters

addressFamily AddressFamily

The address family.

Returns

UdpClient

The UDP client, which the caller owns and disposes.

CreateUdpSocket(AddressFamily)

Creates a UDP socket of an address family, for a worker that manages its own receive buffer.

public virtual Socket CreateUdpSocket(AddressFamily addressFamily)

Parameters

addressFamily AddressFamily

The address family.

Returns

Socket

The socket, which the caller owns and disposes.

Remarks

A UdpClient keeps a receive buffer of its own, too costly for small-buffer workers such as DNS. The interface's default implementation returns the socket of CreateUdpClient(AddressFamily), so a factory that does not implement it keeps its protection, binding and configuration.