t_rcvdis - Retrieve disconnect information
#include <xti.h>
int t_rcvdis(
int fd,
struct t_discon *discon );
XTI Library (libxti.a)
Interfaces documented on this reference page conform to
industry standards as follows:
t_rcvdis(): XNS4.0, XNS5.0
Refer to the standards(5) reference page for more information
about industry standards and associated tags.
The following table summarizes the relevance of input and
output parameters before and after t_rcvdis() is called:
------------------------------------------------
Parameter Before Call After Call
------------------------------------------------
fd y n
discon->udata.maxlen y n
discon->udata.len n y
discon->udata.buf o (o)
discon->reason n y
discon->sequence n o
------------------------------------------------
Notes to Table: This is a meaningful parameter. This is
not a meaningful parameter. This an optional parameter.
The content of the object pointed to by y is optional.
Specifies a file descriptor returned by the t_open() function
that identifies the transport endpoint where a disconnect
occurred. Points to a type t_discon structure
used to specify user-data parameters that can be returned
by the transport user. The t_discon structure has the following
members: Specifies a buffer for transport user data
sent to the caller with the disconnect when the t_rcvdis()
function is processed. The type netbuf structure referenced
by this member is defined in the xti.h include file
and has the following members: Specifies the maximum byte
length of the data buffer. Specifies the actual byte
length of data written to the buffer. Points to the
buffer location. Specifies the reason the disconnect
occurred. Specifies the sequence number identifying an
outstanding connection indication that has been disconnected.
The field sequence is only meaningful when the
t_rcvdis() function is issued by a passive transport user
who has issued one or more t_listen() functions and is
processing the resulting connect indications.
On return, the discon->udata buffer contains
information associated with the disconnect. Before
the t_rcvdis() function is called, udata.maxlen
must be set to specify the maximum byte length of
the user-data buffer.
The discon->reason parameter specifies the reason
for the disconnect using a protocol-dependent reason
code. When protocol independence is a concern,
this information should not be examined.
When this function is called after issuing one or
more t_listen() functions, and there is more than
one outstanding transport endpoint connection
(refer to the t_listen() function), the discon->sequence
parameter is used to specify the outstanding
connection indication with which the disconnect
is associated.
When a transport user is not concerned with incoming
remote transport user data, with a reason for a
disconnect, or with the sequence number of the
transport endpoint where the disconnect took place,
the discon parameter may be specified as a null
pointer. When discon is specified as a null
pointer, no data is returned to the caller.
When a transport user knows there is more than one
active connection indication (refer to the t_look()
function), and this function is called with the
discon parameter set to the null pointer value,
there is no way to identify the connection where
the disconnect occurred.
The t_rcvdis() XTI connection-oriented function is used to
identify the cause of a disconnect at a transport endpoint
specified by a file descriptor returned by the t_open()
function, and to retrieve any user data sent with the disconnect.
Upon successful completion, a value of 0 (zero) is
returned. Otherwise, a value of -1 is returned and t_errno
is set to indicate the error.
If the t_rcvdis() function fails, t_errno is set to one of
the following values: File descriptor fd does not refer to
a valid transport endpoint. No disconnect indication currently
exists on the transport endpoint specified by the
fd parameter. The number of bytes allocated for incoming
data is not sufficient to store the data. When fd specifies
a passive transport endpoint (the number of outstanding
connection indications is greater than 1), the transport
endpoint remains in state T_INCON; otherwise, the
transport endpoint state becomes T_IDLE. A system error
occurred during execution of this function. The
t_rcvdis() function was issued in the wrong sequence on
the transport endpoint referenced by the fd parameter.
This function is not supported by the underlying transport
provider. This error indicates that a communication problem
has been detected between XTI and the transport
provider for which there is no other suitable
XTI(t_errno).
The t_rcvdis() function can be called in the following
transport provider states: T_DATAXFER, T_OUTCON, T_OUTREL,
T_INREL, and T_INCON (when the number of outstanding connections
is greater than 0 (zero)).
Functions: t_alloc(3), t_connect(3), t_listen(3),
t_open(3), t_snddis(3)
Standards: standards(5)
Network Programmer's Guide
t_rcvdis(3)
[ Back ] |