Mentalis.org Security Library documentation

SecureTcpClient.Connect Method (String, Int32)

Connects the client to the specified port on the specified host.

[Visual Basic]
Overridable Overloads Public Sub Connect( _
   ByVal hostname As String, _
   ByVal port As Integer _
)
[C#]
public virtual void Connect(
   string hostname,
   int port
);

Parameters

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

Exceptions

Exception TypeCondition
ArgumentNullExceptionThe hostname parameter is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionport is less than MinPort -or- port is greater than MaxPort.
SocketExceptionAn operating system error occurs while accessing the Socket.
ObjectDisposedExceptionThe SecureSocket has been closed.
SecurityExceptionThe security negotiation failed.

See Also

SecureTcpClient Class | Org.Mentalis.Security.Ssl Namespace | SecureTcpClient.Connect Overload List