Socks4Handler.GetHostPortBytes Method

Mentalis.org ProxySocket

Mentalis.org ProxySocket Documentation

Socks4Handler.GetHostPortBytes Method 

Creates an array of bytes that has to be sent when the user wants to connect to a specific host/port combination.

[Visual Basic]Private Function GetHostPortBytes( _
   ByVal host As String, _
   ByVal port As Integer _
) As Byte()
[C#]
private byte[] GetHostPortBytes(
   string host,
   int port
);

Parameters

host
The host to connect to.
port
The port to connect to.

Return Value

An array of bytes that has to be sent when the user wants to connect to a specific host/port combination.

Remarks

Resolving the host name will be done at server side. Do note that some SOCKS4 servers do not implement this functionality.

Exceptions

Exception Type Condition
System.ArgumentNullException host is null.
System.ArgumentException port is invalid.

See Also

Socks4Handler Class | Socks4Handler Members | Org.Mentalis.Network.ProxySocket Namespace