t_close(3N) t_close(3N)
NAME
t_close - close a transport endpoint
SYNOPSIS
cc [options] file -lnsl
#include <xti.h>
int t_close(int fd);
Parameters
fd the file descriptor for the transport endpoint specified
by 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.
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.
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)
Copyright 1994 Novell, Inc. Page 1
t_close(3N) t_close(3N)
USAGE
t_close should be called from the T_UNBND state [see
t_getstate(3N)]. 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.
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(3N), t_open(3N), t_unbind(3N)
Copyright 1994 Novell, Inc. Page 2