z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


CLOSE

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The CLOSE macro shuts down the socket and frees the resources that are allocated to the socket. Issue the SHUTDOWN macro before you issue the CLOSE macro.

CLOSE can also be issued by a concurrent server after it gives a socket to a subtask program. After issuing GIVESOCKET and receiving notification that the client child has successfully issued TAKESOCKET, the concurrent server issues the CLOSE macro to complete the transfer of ownership.

Note: If a stream socket is closed while input or output data is queued, the stream connection is reset and data transmission can be incomplete. SETSOCKOPT can be used to set a SO_LINGER condition, in which TCP⁄IP continues to send data for a specified period of time after the CLOSE macro is issued. For information about SO_LINGER, see SETSOCKOPT.
The following requirements apply to this call:
Read syntax diagramSkip visual syntax diagram
>>-EZASMI--TYPE=CLOSE--,S--=--+-number---+---------------------->
                              +-address--+   
                              +-*indaddr-+   
                              '-(reg)----'   

>--,ERRNO--=--+-address--+--,RETCODE--=--+-address--+----------->
              +-*indaddr-+               +-*indaddr-+   
              '-(reg)----'               '-(reg)----'   

>--+---------------------------+--+-------------------------+--->
   +-,ECB--=--+-address--+-----+  '-,ERROR--=--+-address--+-'   
   |          +-*indaddr-+     |               +-*indaddr-+     
   |          '-(reg)----'     |               '-(reg)----'     
   '-,REQAREA--=--+-address--+-'                                
                  +-*indaddr-+                                  
                  '-(reg)----'                                  

>--+------------------------+----------------------------------><
   '-,TASK--=--+-address--+-'   
               +-*indaddr-+     
               '-(reg)----'     

Keyword
Description
S
Input parameter. A value or the address of a halfword binary number specifying the socket to be closed.
ERRNO
Output parameter. A fullword binary field. If RETCODE is negative, ERRNO contains a valid error number. Otherwise, ignore ERRNO field.

See Socket call error return codes for information about ERRNO return codes.

RETCODE
Output parameter. A fullword binary field that returns one of the following values:
Value
Description
0
Successful call.
-1
Check ERRNO for an error code.
ECB or REQAREA
Input parameter. This parameter is required if you are using APITYPE=3. It points to a 104-byte field containing:
For ECB
A 4-byte ECB posted by TCP/IP when the macro completes.
For REQAREA
A 4-byte user token (set by you) that is presented to your exit when the response to this function request is complete.
For ECB/REQAREA
The last 100 bytes is a storage field used by the interface to save the state information.
Note: This storage must not be modified until the macro function has completed and the ECB has been posted, or the asynchronous exit has been driven.
ERROR
Input parameter. The location in your program to receive control when the application programming interface (API) processing module cannot be loaded.
TASK
Input parameter. The location of the task storage area in your program.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014