Dart Telnet Control
Connect Method
Specifies either a host name (host.dart.com) or dot address (nnn.nnn.nnn.nnn).
Specifies a remote port between 1 and 65535, inclusive. Defaults to the well-known port 23.
Specifies the local network interface (either a host name, host.dart.com, or dot address, nnn.nnn.nnn.nnn).
Species the local port.
Description
Establish a connection. The State property immediately changes to tcpConnecting and changes to tcpConnected when the connection is established, the security protocol is negotiated and authentication succeeds. The State property can be checked in the body of the State Event, polled off a timer, or checked immediately after this method is used when a positive Timeout is specified.
Syntax
Visual Basic
Public Sub Connect( _
   ByVal RemoteName As String, _
   Optional ByVal RemotePort As Long = 0, _
   Optional ByVal LocalName As String, _
   Optional ByVal LocalPort As Long = 0 _
) 
Parameters
RemoteName
Specifies either a host name (host.dart.com) or dot address (nnn.nnn.nnn.nnn).
RemotePort
Specifies a remote port between 1 and 65535, inclusive. Defaults to the well-known port 23.
LocalName
Specifies the local network interface (either a host name, host.dart.com, or dot address, nnn.nnn.nnn.nnn).
LocalPort
Species the local port.
Remarks

This method blocks if Timeout is greater than 0. The Blocked property may be checked to verify the control is not executing another method.

Error Codes
The Connect method may generate the following error codes (refer to the ErrorConstants topic for a complete list of error codes):

 

Example
This VB example shows how to establish a Telnet connection.
Private Sub Command1_Click()
On Error GoTo OnError
	Telnet1.Connect "catalogue.library.ubc.ca"
	If Telnet1.State = tcpConnected Then
	Label1.Caption = "Connection is active and can send/receive data."
	End If
	Exit Sub
OnError:
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Telnet Object  | Telnet Members


Documentation Version 1.9.3.0
© 2020 Dart Communications. All Rights Reserved.
Send comments on this topic