t_close - close a transport endpoint
#include <xti.h>
int t_close(
int fd)
The t_close(3) function informs the transport provider that the user is finished with the transport endpoint specified by fd, and frees any local library resources associated with the endpoint. In addition, t_close(3) closes the file associated with the transport endpoint.
Parameters | Before call | After call |
---|---|---|
fd | x | / |
The function t_close(3) should be called from the T_UNBND state (see t_getstate(3)). However, this function 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, close(3) will be issued for that file descriptor; if there are no other descriptors in this process or in another process which references the communication endpoint, any connection that may be associated with that endpoint is broken. The connection may be terminated in an orderly or abortive manner.
A t_close(3) 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.
ALL - apart from T_UNINIT
On failure, t_errno is set to one of the following values:
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate an error.
t_getstate(3)
t_open(3)
t_unbind(3)