t_close - close a transport endpoint
#include <xti.h> int t_close(int fd);
Parameters Before call After call
fd x /
t_close()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()closes the file associated with the transport endpoint.
t_close()should be called from the T_UNBND state (see t_getstate()). 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()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.
t_close()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.
For advice on how to write protocol-independent applications, see
Writing Protocol-independent Software. For information on protocol-specific behaviour of t_close(), see the XTI Appendix for the relevant transport provider.
ALL - apart from T_UNINIT
On failure, t_errno is set to the following:
- The specified file descriptor does not refer to a transport endpoint.
- This error indicates that a communication problem has been detected between XTI and the transport provider for which there is no other suitable XTI error (t_errno).
- A system error has occurred during execution of this function.
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(), t_open(), t_unbind().
The SYNOPSIS section is placed in the form of a standard C function prototype.