|
Description
The user calls the t_close() function to inform the transport provider that he no longer needs the transport endpoint specified by fd. t_close() releases all local library resources reserved for fd.
t_close() should be called in the T_UNBND state (see section "t_getstate() - get current state"). As t_close() does not check any state information, it can also be called in all other states to close a transport endpoint.
If there are no further descriptors for transport endpoint fd in the calling process or any other process, the transport endpoint is shut down completely, i.e. the system resources are released. Established connections are aborted and any data not already sent or not fetched by the receiver is lost.
Return value
0:
If successful.
-1:
If an error occurs. t_ errno is set to indicate the error.
Errors
TBADF
The specified file descriptor does not reference a transport endpoint.