BPX4ACP (accept) example
The following code does an accept to accept a connect
request from a client. SOCKDESC was previously set by a call
to BPX4SOC. A bind and a listen must also have been previously
done. The SOCKADDR was built by the call to BPX4BND. For
the callable service, see accept (BPX1ACP, BPX4ACP) — Accept a connection request from a client socket.
For the data structure, see BPXYSOCK — Map SOCKADDR structure and constants.
AMODE 31 callers
use BPX1ACP (accept) example.
CALL BPX4ACP, Accept a socket connect request +
(SOCKDESC, Input: Socket descriptor +
=A(SOCK#LEN+SOCK_SUN#LEN), Input: Length - Sockaddr +
SOCKADDR, Input: Sockaddr structure +
RETVAL, Return value: 0 or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
MF=(E,PLIST) ----------------------------------
L R2,RETVAL
ST R2,SOCKDES2 Store the new socket descriptor