Connects a process to a server.
&SOCKET CONNECT
{ ADDRESS=ip_address | HOSTNAME=host_name }
PORT=port_id
[ WAIT={ time | 30 } ]
[ TYPE={ SYNC | ASYNC }]
CONNECT attempts to establish a connection to the server, at the host specified by IP address or host name on the specified port number.
Operands:
Specifies the IP address of the host.
Specifies the name of the host to which you are connecting.
(Mandatory) Specifies the TCP port number that the server is waiting on for client connections. TCP port numbers range from 0 to 65535.
Specifies the time (in seconds)to wait for the host to respond. The default value is 30 seconds.
Indicates whether this is a synchronous (SYNC) or asynchronous (ASYNC) socket request.
If TYPE=ASYNC is specified, WAIT cannot be specified.
If TYPE=ASYNC is specified, the verb returns control immediately, and a notification message is queued to the dependent environment when CONNECT completes:
N00101 NOTIFY: TCP/IP EVENT: CONNECT RESOURCE: RC=rc RSN=rsn ERR=errno VERRIN=vendor_info ID=new_socket_id **addr/name**
where **addr/name** is set to the destination specified on the CONNECT request (that is, either ADDRESS=ip_address or HOSTNAME=host_name)
Note: ID= is omitted if the CONNECT fails.
Examples: &SOCKET CONNECT
&SOCKET CONNECT ADDRESS=172.24.91.45 PORT=&PRT
&SOCKET CONNECT HOSTNAME=TESTMVS1 PORT=&PRT
Return Codes:
Connect successful
Connect failed; see &ZFDBK for reason code, &ZSOCERRN and &ZSOCVERR for further error information.
Notes:
The verb is executed only by the client in client/server applications using TCP sockets.
The &ZSOCID system variable contains the socket number to be used for communications with the server.
| Copyright © 2009 CA. All rights reserved. |
|