'\"macro stdmacro
.if n .pH g3n.t_rcvdis @(#)t_rcvdis	40.5 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_rcvdis 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_rcvdis 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_rcvdis 3N "" "\&"
.if \nX=3 .ds x} t_rcvdis "" "" "\&"
.if \nX=4 .ds x} t_rcvdis "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_rcvdis\f1 \- retrieve information from disconnect
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4t_rcvdis (int fd, struct t_discon \(**discon);\f1
.SH DESCRIPTION
This function is used to identify the cause of a disconnect, and
to retrieve any user data sent with the disconnect.
\f4fd\fP
identifies the local transport endpoint where the connection existed,
and
\f4discon\fP
points to a \f4t_discon\f1 structure containing the following members:
.PP
.RS
.ft4
struct netbuf udata;
.br
int reason;
.br
int sequence;
.ftP
.RE
.PP
\f4netbuf\f1 is described in \f4intro\fP(3).
\f4reason\fP specifies the reason for the disconnect
through a protocol-dependent reason code,
\f4udata\fP
identifies any user data that was sent with the disconnect, and
\f4sequence\fP
may identify an outstanding connect indication with which the disconnect is
associated.
\f4sequence\fP
is only meaningful when
\f4t_rcvdis\fP
is issued by a passive transport user who has executed one or more
\f4t_listen\fP
functions and is processing the resulting connect indications.
If a disconnect indication occurs,
\f4sequence\fP
can be used to identify which of the outstanding connect indications is
associated with the disconnect.
.PP
If a user does not care if there is incoming data and does not need to
know the value of
\f4reason\fP
or
\f4sequence\fP,
\f4discon\fP
may be \s-1NULL\s+1
and any user data associated with the disconnect will be discarded.
However, if a user has retrieved
more than one outstanding connect indication (via
\f4t_listen\fP)
and
\f4discon\fP
is \s-1NULL\s+1,
the user will be unable to identify which connect indication the
disconnect is associated with.
.P
On failure, \f4t_errno\f1 may be set to one of the following:
.TP 20
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport endpoint.
.TP
\f4[TNODIS]\fP
No disconnect indication currently exists on the specified
transport endpoint.
.TP
\f4[TBUFOVFLW]\fP
The number of bytes allocated for incoming data is not
sufficient to store the data.
The provider's state, as seen by the user, will change to
\f4T_IDLE\fP,
and the disconnect indication information to be returned in
\f4discon\fP
will be discarded.
.TP
\f4[TNOTSUPPORT]\fP
This function is not supported by the underlying transport
provider.
.TP
\f4[TSYSERR]\fP
A system error has occurred during execution of this function.
.bp
.SH SEE ALSO
\f4intro\fP(3), \f4t_connect\fP(3N),
\f4t_listen\fP(3N),
\f4t_open\fP(3N),
\f4t_snddis\fP(3N).
.sp .2
\f2UNIX System V Network Programmer's Guide\f1.
.SH DIAGNOSTICS
\f4t_rcvdis\fP
returns 0 on success and \-1 on failure and
\f4t_errno\f1 is set to indicate the error.
.Ee
