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 [Boolean] = tnxxxx.Connect(Timeout As Integer)
Delphi [Boolean] := tnxxxx.Connect(Timeout:Integer);
The following graphic shows the sequence of actions corresponding to the synchronous Connect method:
Examples:
VB: Private Sub cmdConnect_Click() telnet.Host = "clemson.clemson.edu" If telnet.Connect(10000) Then MessageBox.Show("Connected!") End If End Sub
Delphi: procedure TForm1.Button1Click(Sender: TObject); begin tnb3270.Host := 'clemson.clemson.edu'; if tnb3270.Connect(10000) then ShowMessage('Connected!'); end;
|