t_close - close a transport endpoint
#include <xti.h>
int t_close(
int fd)
Parameters Before call After call fd x / The
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.The function
t_close() should be called from the T_UNBND state (seet_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.A
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 oft_close() , see the XTI Appendix for the relevant transport provider.
ALL - apart from T_UNINIT
On failure, t_errno is set to 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 XTI and the transport provider for which there is no other suitable XTI error (t_errno).
- [TSYSERR]
- 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.
Contents | Next section | Index |