Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
GIVESOCKET z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
Use the GIVESOCKET command to transfer a socket descriptor to another application that is running on the same host. The other application can use the TAKESOCKET command to take the socket. If the socket is closed before an application can take it, then the socket is reset. Any stream socket can be given. Restriction: A socket given by the GIVESOCKET command
can be taken only by a process that issues the TAKESOCKET command
with the same address family.
Guideline: The application that issues the GIVESOCKET command can
use the SELECT command to test for a socket exception condition. The
exception condition indicates that the socket has been successfully
taken by another application. After the socket has been successfully
taken, the application that issued the GIVESOCKET command can safely
close the socket. For example, when a server accepts a new connection,
the server issues the GIVESOCKET command and then monitors the socket
for an exception condition using the SELECT command. The server subtask
issues the TAKESOCKET command. After the subtask takes the socket,
the server issues the CLOSE command and waits for a new connection
request.
Parameters
Returned valueThe command returns a string that contains the return code. The return code can be 0, a REXX socket API error number, or the REXX TCP/IP error number that is set by the socket command. The return code 0 indicates that the requested socket command was completed successfully. See Socket call error return codes for additional information about the numeric error codes that are returned by this command. The following REXX socket API error number can be returned:
The following REXX socket API error numbers can be returned:
LE C/C++ equivalent
Code exampleSee the EZARXS04 REXX sample in the SEZAINST file for an example of using the GIVESOCKET command. |
Copyright IBM Corporation 1990, 2014
|