Introduction | Language Structure | IB Statements | File System | Comet 32 Runtime | Index |
Control: CONNECT
Syntax: result-string =
CONTROL(lun,"CONNECT server
port")
Description: The CONNECT control establishes a connection with a peer system via the Winsock gateway.
The result-string will contain a return value after the control is executed (see below).
The lun is the logical unit number of an open Winsock gateway.
The server is the domain name or IP address of the peer system to which the lun is to be connected.
The port is the name of the service by which the connection will be used. This value may be a decimal port value (0 through 65,535) or text. If it is text, it is assumed to be a service name. Service names are automatically translated to the port number used by the service in accordance with RFC 1060. Windows Sockets uses the SERVICES text file found in the Windows directory when translating service names to port values.
Note: The default TIMEOUT for this control is changed to 60 seconds, unless the programmer has changed the TIMEOUT value to some other value.
This control is synonymous with the OPEN control.
Return Values:
If no error occurs, this control returns +OK followed by the network address and port number of the peer to which it has connected. Otherwise, it returns –ERR followed by detailed information on the nature of the error. These values are returned in the result-string.
Exceptions:
EXCP 10 Comet timed out waiting for connection to complete. The default timeout is 60 seconds, unless changed using the TIMEOUT command.
EXCP 29 Winsock returned a network error when attempting to establish the connection. The error is formatted and placed in the DOS PATH field of QENDITOR and QERRLOG. It may also be queried from the Winsock gateway using the GETERROR command.
EXCP 34 CONNECT was called while a connection was already active on the Winsock gateway lun.
EXCP 45 A syntax error was detected parsing the CONNECT command string.
Examples: A$ = CONTROL(1,"CONNECT ftp.microsoft.com
ftp")
A$ =
CONTROL(1,"CONNECT 192.168.1.12 mail")
A$ =
CONTROL(1,"CONNECT 207.48.81.100 7777")