Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Giving a socket to a subtask z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
The socket represented by the new socket descriptor has to be passed
to an available subtask. Which technique the main process uses to
find an available subtask is not important. Assume that the main
process has located an available subtask to which it gives the socket
by way of a givesocket() call as shown in Figure 1:
Figure 1. Giving a socket to a subtask
If you are programming in C, you might not be able to determine
the full client ID of the subtask. In that case, you can pass the
task ID field as eight blanks on the givesocket() call, which means
that any task within your own address space can take the socket, but
only the task to which you pass the socket descriptor number will
actually take it.
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. |
Copyright IBM Corporation 1990, 2014
|