Registers a socket.
&SOCKET REGISTER [ PORT=port_id ] [ CONVLIM=nn ]
REGISTER is used by a server application to obtain a socket, bind it to a specified TCP port, and issue a listen on the socket, specifying the queue depth given by the CONVLIM parameter.
Operands:
Specifies the TCP port number to be used by the socket. Port numbers range from 1 to 65535, with the default being 0, in which case the system allocates its own port number. (See Notes below.)
Specifies the limit for waiting conversations, this being the maximum number of clients that is waiting for their connection request to be ACCEPTED at any one time. The default value is 100.
Examples: &SOCKET REGISTER
&SOCKET REGISTER CONVLIM=10 PORT=&PRT
Return Codes:
Register successful
Register failed; see &ZFDBK for reason code, &ZSOCERRN and &ZSOCVERR for further error information.
Notes:
The &SOCKET REGISTER is executed only by the server in client/server applications.
Usually a server application will have an NCL process handling a socket created by &SOCKET REGISTER and using &SOCKET ACCEPT to accept inbound connection requests. This process also starts independent processes to handle each connection. The &SOCKET TRANSFER_REQUEST and TRANSFER_ACCEPT verbs are used to transfer the connection to the new process.
The information returned is set into the NCL variable, &ZSOCID. This variable will contain the socket number to be used when referring to the registered socket.
Some TCP/IP interfaces, for example Fujitsu TISP, have special requirements regarding pre-definitions of ports.
| Copyright © 2009 CA. All rights reserved. |
|