*---------------------------------------------------------------------*
*Give socket to subtask *
*---------------------------------------------------------------------*
MVC CLNNAME,TPIMCNAM *Our Client ID Address Space Name
MVC CLNTASK,TPISTCBE *Give to this subtask
EZASMI TYPE=GIVESOCKET, *Givesocket C
S=NEWSOC, *Give this socket descriptor C
CLIENT=CLNSTRUC, *- to a specific child process C
ERRNO=ERRNO, C
RETCODE=RETCODE, C
ERROR=EZAERROR
ICM R15,15,RETCODE *OK ?
BM EZAERROR *- No, tell about it.
*
* CLNSTRUC DS 0F *GIVESOCKET: Client structure
CLNFAM DC A(2) *TCP/IP Addressing family
CLNNAME DC CL8' ' *Address space name of target
CLNTASK DC CL8' ' *Task ID of child process subtask
CLNRESV DC XL20'00' *Reserved
*
NEWSOC DC AL2(0) *Socket descriptor from Accept
*
ERRNO DC A(0) *Error number from EZASMI
RETCODE DC A(0) *Returncode from EZASMI
After you have issued the givesocket() call, you must include the given socket descriptor in the exception select mask on the next select() call.
Your main process is now ready to wake up the selected subtask by way of a post system call.
If no other sockets were selected on the previous select() call, your main process can build a new set of select masks, and issue a new select() call.