Connect Method

Top  Previous  Next

The Connect method establishes the connection to the Telnet server. The Host and Port properties must be assigned for the connection to be successfully established.

 

VB.NET Syntax

 

tnxxxx.Connect

 

[Boolean] = tnxxxx.Connect(Timeout as Integer)

 

C# Syntax

 

tnxxxx.Connect();

 

[bool] = tnxxxx.Connect(int Timeout);

 

 

Remarks

 

Try to establish the connection to the specified Host and Port. In first form, this is done in asynchronous fashion, returning the control inmediatelly. In second form, it blocks the code execution waiting until the connection is succesfully established or the specified timeout expires.

 

If the specified host doesn't exist or if the connection fails, the OnConnectionFail event is fired. If the connection is successfully established, the OnConnect event is fired.

 

See also Host and Port properties, Disconnect method, OnConnect and OnConnectionFail events.