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


TcpClose

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

Use the procedure shown in Figure 1 to begin the TCP one-way closing sequence. During this closing sequence, you, the local client, cannot send any more data. Data might be delivered to you until the foreign application also closes. TcpClose also causes all data sent on that connection by your application, and buffered by TCPIP, to be sent to the foreign application immediately.

Figure 1. TcpClose example
   procedure TcpClose
            (
                 Connection: ConnectionType;
        var    ReturnCode: integer
            );
            external;
Parameter
Description
Connection
The connection number, as returned by TcpOpen or TcpWaitOpen in the Connection field of the StatusInfoType record.
ReturnCode
Indicates success or failure of call. Possible return values are:
  • OK
  • ABNORMALcondition
  • ALREADYclosing
  • NOsuchCONNECTION
  • NOTyetBEGUN
  • TCPipSHUTDOWN
  • SOFTWARError
  • REMOTEreset
For a description of Pascal return codes, see Table 1.
Notes:
  1. If you receive the notification CONNECTIONstateCHANGED with a NewState of SENDINGonly, the remote application has done TcpClose (or an equivalent function) and is receiving only. Respond with TcpClose when you finish sending data on the connection.
  2. The connection is fully closed when you receive the notification CONNECTIONstateCHANGED, with a NewState field set to NONEXISTENT.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014