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. |
0 | Successful completion. |
-1 | t_errno is set to indicate an error. |
On failure, t_errno is set to one of the following:
The t_getstate subroutine, t_open subroutine, t_unbind subroutine.