retrieve information from disconnect
cc [options] file -lnsl
int t_rcvdis(int fd, struct t_discon discon);
This function is a TLI/XTI connection release routine
used to identify the cause of a disconnect and
to retrieve any user data sent with the disconnect.
fd is used by the calling transport user to
identify the local transport endpoint where the connection existed,
and on return discon points to the information associated
with the disconnection.
the file descriptor for the transport endpoint where the connection
had been established.
points to the t_discon structure associated with the
The discon argument points to a t_discon structure
containing the following members:
struct netbuf udata; /* user data */
int reason; /* reason code */
int sequence; /* connect ind. */
netbuf is described in
reason specifies the reason for the disconnect
through a protocol-dependent reason code,
udata identifies any user data that was sent with the disconnect,
sequence may identify an outstanding connect indication
with which the disconnect is associated.
sequence is only meaningful when t_rcvdis
is issued by a passive transport user which has executed one or more
t_listen functions and is processing the resulting connect
If a disconnect indication occurs,
can be used to identify which of the outstanding connect indications is
associated with the disconnect.
If a user does not care if there is incoming data and does not need to
know the value of
discon may be NULL,
and any user data associated with the disconnect will be discarded.
However, if a user has retrieved
more than one outstanding connect indication (via t_listen)
and discon is NULL,
the user will be unable to identify which connect indication the
disconnect is associated with.
t_rcvdis may be issued from any valid state except
T_UNINIT, T_UNBND, or T_IDLE.
Valid states on exit are
T_IDLE (successful) and T_INCON (successful but
there are connect indications outstanding).
X/Open® Transport Interface Library (shared object)
Network Services Library (shared object)
t_rcvdis returns 0 on success and -1 on failure and
t_errno is set to indicate the error.
On failure, t_errno may be set to one of the following:
The specified file descriptor does not refer to a transport endpoint.
No disconnect indication currently exists on the specified
The number of bytes (
maxlen) allocated for incoming data
is greater than zero but not sufficient to store the data.
If fd is a passive endpoint with ocnt>1, it remains
in state T_INCON; otherwise, the endpoint state is set
The disconnect indication information to be returned in
discon will be discarded.
This function is not supported by the underlying transport
A system error has occurred during execution of this function.
The function was issued in the wrong sequence
on the transport endpoint referenced by fd.
A communication problem has been detected with the transport provider
and there is no other value of t_errno to describe
the error condition.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004