Synchronous Connection

Top  Previous  Next

This method try to establish the connection to the specified Host and Port. This call blocks the code execution, while waits until the connection is succesfully established or the specified timeout expires.

 

The Host and Port properties must be set for the connection to be successfully established.

 

VB.NET

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

 

C#

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

 

 

The following graphic shows the sequence of actions corresponding to the synchronous Connect method:

 

 Host Integration Pack TN Bridge Vb.net C# Delphi ActiveX synchronous connect method

 

 

Examples:

 

 VB.NET:

 Private Sub cmdConnect_Click(eventSender As object, eventArgs As System.EventArgs)

   tn3270.Host = "clemson.clemson.edu"

  If tn3270.Connect(10000) Then

          MessageBox.Show("Connected!")

        End If

 End Sub

 

 C#:

 private void cmdConnect_Click(object eventSender, System.EventArgs eventArgs)

 {

         tn3270.Host = "clemson.clemson.edu";

         if (tn3270.Connect(10000))

         {

                 MessageBox.Show("Connected!");

         }

 }