DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

t_close(3xti)


t_close -- close a transport endpoint

Synopsis

cc [options] file -lnsl
#include <xti.h>

int t_close(int fd);

Description

This function is a TLI/XTI local management routine used to close a transport endpoint. The t_close function indicates to the transport provider that the user is finished with the transport endpoint specified by fd. In addition, t_close closes the file associated with the transport endpoint and frees any local library resources associated with the endpoint.

Parameters


fd
the file descriptor for the transport endpoint specified by fd.

State transitions

On entry, any except T_UNINIT; T_UNINIT on exit.

Files


/usr/lib/libxti.so
X/Open® Transport Interface Library (shared object)

/usr/lib/libnsl.so
Network Services Library (shared object)

Usage

t_close should be called from the T_UNBND state (see t_getstate(3xti)). However, this function does not check state information, so it may be called from any valid state to close a transport endpoint. If this occurs, the local library resources associated with the endpoint will be freed automatically.

Return values

t_close returns 0 on success and -1 on failure and t_errno is set to indicate the error.

Errors

On failure, t_errno may be set to the following:

TBADF
The specified file descriptor does not refer to a transport endpoint.

TPROTO
A communication problem has been detected with the transport provider and there is no other value of t_errno to describe the error condition.

Warnings

If t_close is issued while a transport address is bound to an endpoint, the address will be unbound.

If t_close is called when the transport connection is still active, the connection will be aborted, the file descriptor will be closed, and the transport connection associated with that endpoint will be broken for any process that references that endpoint.

t_close should not be issued on a connection endpoint before data has been successfully transmitted and received or data may be lost.

References

t_getstate(3xti), t_open(3xti), t_unbind(3xti)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004