The following code takes a socket that was given by the
program identified by CID (clientid). SOCKDESC and CID information
are passed by the program that did the givesocket (BPX1GIV).
SOCKDESC is the giver's descriptor.
When takesocket completes successfully, RETVAL will contain the taker's
new socket descriptor. For the callable service, see
takesocket (BPX1TAK, BPX4TAK) — Acquire a socket from another program. For the data structure,
see
BPXYCID — Map the returning structure for getclientid(). AMODE
64 callers use
BPX4TAK (takesocket) example.
CALL BPX1TAK, take a socket from another program+
(CID, Input: Clientid of giver +
SOCKDESC, Input: Giver's socket descriptor +
RETVAL, Return value: -1 or new descriptor+
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------
L R2,RETVAL
ST R2,SOCKDES2 Store the new socket descriptor