Mentalis.org Security Library documentation

SecureTcpClient Constructor (String, Int32, SecurityOptions)

Initializes a new instance of the SecureTcpClient class and connects to the specified port on the specified host.

[Visual Basic]
Overloads Public Sub New( _
   ByVal hostname As String, _
   ByVal port As Integer, _
   ByVal options As SecurityOptions _
)
[C#]
public SecureTcpClient(
   string hostname,
   int port,
   SecurityOptions options
);

Parameters

hostname
DNS name of the remote host to which you intend to connect.
port
Port number of the remote host to which you intend to connect.
options
The security options to use.

Exceptions

Exception TypeCondition
ArgumentNullExceptionhostname is null (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionport is less than MinPort -or- port is greater than MaxPort.
SocketExceptionAn error is encountered when resolving hostname -or- an error occurred while connecting to the remote host.
SecurityExceptionThe security negotiation failed.

See Also

SecureTcpClient Class | SecureTcpClient Members | Org.Mentalis.Security.Ssl Namespace | SecureTcpClient Constructor Overload List