CLOSE
The CLOSE call shuts down a socket and frees all resources allocated to it. If the socket refers to an open TCP connection, the connection is closed.
After an unsuccesful socket call, a CLOSE should be issued and a new socket should be opened. An attempt to use the same socket with another call results in a nonzero return code.
Example of CLOSE call
SOC_FUNCTION DC CL16'CLOSE'
S DS H
ERRNO DS F
RETCODE DS F
CALL DFHSOKET,(SOC_FUNCTION,S,ERRNO,RETCODE)
Input parameters
- SOC_FUNCTION
- A 16-byte field containing CLOSE. Left-justify the field and pad it on the right with blanks.
- S
- A halfword binary field containing the descriptor of the socket to be closed.
Output parameters
- ERRNO
- A fullword binary field. If RETCODE is negative, this field contains an error number. See Return codes, for information about ERRNO return codes.
- RETCODE
- A fullword binary field that returns one of the following:
- Value
- Description
- 0
- Successful call
- -1
- Check ERRNO for an error code