3. CLOSE
This operation is a request that the specified local socket be returned to the closed state. If the last operation involving this socket was a LISTEN, this operation refuses the foreign process' connection attempt. If the last operation was a CONNECT, the attempt is aborted. If a connection is established, any data in transit from the local socket is allowed to reach the foreign socket and to be either received or flushed before the local socket is closed. The subprogram will wait until the socket has been returned to the closed state.
The calling sequence is as follows:
CALL @CLOSE(cmpcd, time);
where
cmpcdis the completion code variable associated with the local socket.timeis the length of time the subprogram is to wait for the completion of the operation.
The following completion codes are possible for this operation:
| Code | Description |
|---|---|
| 0 | The operation was successful, and the socket has been returned to the closed state |
| 8 | The specified completion code variable is not currently assigned to a socket; the operation was suppressed |
| 12 | The specified local socket is in the process of being closed; the operation was suppressed, but the local socket will be closed |
| 36 | Either hardware at the foreign site is inoperative, or the NCP's counterpart at the foreign site does not exist or has failed |
| 44 | By operator command, all Network operations were terminated; the socket will be closed |
| 60 | An NCP control transmission error occurred; the operation was aborted |
| 64 | A transmission error occurred; the operation was aborted, but the socket will be closed |
| 252 | The specified time limit was exceeded; the operation was initiated but not completed |