[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 2

t_close Subroutine for X/Open Transport Interface


Close a transport endpoint.


X/Open Transport Interface Library (libxti.a)


#include <xti.h>
int t_close (fd)
int fd;


The t_close subroutine informs the transport provider that the user is finished with the transport endpoint specified by the fd parameter and frees any local library resources associated with the endpoint. In addition, the t_close subroutine closes the file associated with the transport endpoint.

The t_close subroutine should be called from the T_UNBND state (see the t_getstate subroutine). However, this subroutine does not check state information, so it may be called from any state to close a transport endpoint. If this occurs, the local library resources associated with the endpoint will be freed automatically. In addition, the close subroutine is issued for that file descriptor. The close subroutine is abortive if there are no other descriptors in this process or if there are no other descriptors in another process which references the transport endpoint, and in this case, will break any transport connection that may be associated with that endpoint.

A t_close subroutine issued on a connection endpoint may cause data previously sent, or data not yet received, to be lost. It is the responsibility of the transport user to ensure that data is received by the remote peer.


fd Specfies the transport endpoint to be closed.

Valid States

ALL - apart from T_UNINIT.

Return Values

0 Successful completion.
-1 t_errno is set to indicate an error.


On failure, t_errno is set to one of the following:

TBADF The specified file descriptor does not refer to a transport endpoint.
TPROTO This error indicates that a communication problem has been detected between the X/Open Transport Interface and the transport provider for which there is no other suitable X/Open Transport Interface (t_errno).

Related Information

The t_getstate subroutine, t_open subroutine, t_unbind subroutine.

[ Previous | Next | Contents | Glossary | Home | Search ]