Home > Language Reference > Classes > StreamSocket

Connect Method

Opens a TCP/IP network connection.

Syntax

Public Sub Connect(ByRef sHost As String, ByVal lPort As Long, Optional ByRef objSSL As SslContext = Nothing)

ParameterDescription
sHostName or IP address of the remote host.
lPortPort number.
objSSLAn instance of an SslContext object if the connection is to be secured with SSL, or Nothing.

Remarks

The Connect method establishes a connection with a remote host. If no connection is already active, this method initializes the handheld device's TCP/IP library using the settings in the "Connection" and "Network" tabs in the configuration panel. If necessary, the network configuration of the device can be modified prior calling this method, using the Connection and Network objects.

The sHost parameter identifies the remote host. If this parameter does not contain a dotted decimal IP address, the string is considered to be a name that will be resolved by calling a DNS. The lPort parameter specifies the port on which to establish the connection, and should be a value between 0 and 65535 inclusive. The objSSL parameter determines whether to secure the connection with SSL or not. For more information on SSL, please refer to the SslContext class.

All connections opened with this method should be closed by calling the Disconnect method.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A