base.Channel.openClientSocket

Open a TCP client socket channel.

Syntax

openClientSocket(
   host STRING,
   port INTEGER,
   mode STRING,
   timeout INTEGER )
  1. host is the name of the host machine you want to connect to.
  2. port is the port number of the service.
  3. mode is the open mode, see usage for details.
  4. timeout is the timeout in seconds. -1 indicates no timeout (wait forever)

Usage

Use the openClientSocket() method to establish a TCP connection to a server.

Pay attention to character set used by the network protocol you want to use by opening a channel with this method: The protocol must be based on ASCII, or must use the same character set as the application.

The host parameter defines the host name of the server.

The port parameter defines the TCP port to connect to.

The opening mode can be one of the following:

If the opening mode is not one of the above letters, the method will raise error -8085.

When the timeout parameter is -1, the connection waits forever.

The method raises error -8084 if the channel cannot be opened.

CALL ch.openClientSocket( "localhost", 80, "u", 5 )