Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Taking sockets from the main process z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
As shown in Figure 1, the
subtask is reactivated by the post() call issued from the main process,
and immediately issues a takesocket() call to receive the socket passed
from the main process. Figure 1 illustrates
this process.
Figure 1. Taking sockets
from the main process
In order to take a socket, the subtask must know the client
ID of the task that gave the socket, and the socket descriptor used
by that task. These values must be passed to the subtask from the
main process before a takesocket() call can be issued.
On the takesocket() call, you specify the full client ID of the process that gave the socket, and you specify the socket descriptor number used by the process that gave the socket. A new socket descriptor number to be used by the subtask is returned in the RETCODE when the takesocket() call is successful. As soon as your subtask has taken the socket, the main process is posted in its pending select with a pending exception activity; this means that the main process must close its socket descriptor. In Figure 1, the client sends its request to the subtask, which processes it and sends back a reply. Finally, the client process and the server subtask close their sockets, and the server subtask reenters wait-for-work status. |
Copyright IBM Corporation 1990, 2014
|