z/OS Communications Server: IP Programmer's Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Records sent by the server to the client: Termination record

z/OS Communications Server: IP Programmer's Guide and Reference
SC27-3659-02

The termination record is sent when the server closes the connection. The termination record can be recognized as having a TmiHr_Id equal to TmiHr_Term. The connection might be closed as part of normal operation (for example the service is being disabled or the stack is terminating), or it might be closed as the result of some error. A termination code in the record indicates the termination reason.

This record is the last data sent by the server before close; after sending the termination record, the server closes the connection. The stack attempts to send the termination record before it closes the socket. However, under certain abnormal stack termination conditions, it might be unsuccessful; furthermore, if the client's receive buffer is full, it might also be unsuccessful. In such cases the connection is closed.

The format of this record is as follows, as defined in ezbytmih.h (an assembler mapping for this structure is in EZBYTMIA):
struct tmi_term                         /* Termination notification rcd */
{
struct tmi_header    tmit_hdr;          /* Record header */
unsigned int         tmit_termcode;     /* Termination code */
char                 tmit_tstamp[8];    /* Termination timestamp */
char                 tmit_rsvd[12];     /* Reserved */
};

The possible values for tmit_termcode and their explanations are as follows, as defined in errno.h:

Value Description
0 No error; planned termination. Either this function is being disabled or the TCP⁄IP stack is ending.
EACCES (111) The client is not permitted to connect to the server.
EINVAL (121) The client has sent data that is not valid to the server.
ENOMEM (132) The server was unable to allocate necessary storage.
EPIPE (140) The client has erroneously sent data to the server when the server was not expecting data.
EWOULDBLOCK (1102) The server could not write to the client socket because the client's receive buffer is full (in which case it is possible that the server might not have been able to write this record and closed the connection).

The tmit_tstamp field contains an 8-byte MVS™ TOD clock value for the time of termination of the connection.

The client should expect to receive no more data on the connection following this record; the connection is closed by the server.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014