Services incoming connection requests.
&SOCKET ACCEPT ID=socket_id [TYPE={SYNC | ASYNC}]
ACCEPT is used by a server application to accept incoming connection requests from a client and create a new socket.
Operands:
Specifies the identity of the socket created by &SOCKET REGISTER.
Indicates whether this is a synchronous (SYNC) or asynchronous (ASYNC) socket request. If TYPE=ASYNC is specified, the verb returns control immediately, and a notification message is queued to the dependent environment when ACCEPT completes:
N00101 NOTIFY: TCP/IP EVENT: ACCEPT RESOURCE: RC=rc RSN=rsn ERR=errno VERRIN=vendor_info ID=new_socket_id
Note: ID= is omitted if the ACCEPT fails.
Examples: &SOCKET ACCEPT
&SOCKET ACCEPT ID=&SOCKETID TYPE=SYNC
Return Codes:
Accept successful
Accept failed; see &ZFDBK for reason code, &ZSOCERRN and &ZSOCVERR for further error information.
Notes:
When you are writing a server application, use &SOCKET REGISTER to start listening for incoming connection requests.
You would normally start another NCL process to handle the new connection and use &SOCKET TRANSFER_REQUEST to pass the connection to that process.
The &ZSOCID system variable contains the socket number to be used for communications with the client.
The port number and IP address of the remote system are available by referencing the &ZSOCPRT and &ZSOCHADR system variables.
Use TYPE=ASYNC so that your NCL process does not wait for connection requests in &SOCKET ACCEPT.
The &SOCKET ACCEPT verb is executed only by the server in client/server applications.
| Copyright © 2009 CA. All rights reserved. |
|