t_rcvdis.3 (2010 09)
t
t_rcvdis(3) t_rcvdis(3)
NAME
t_rcvdis() - retrieve information from disconnect
SYNOPSIS
#include <xti.h> /* for X/OPEN Transport Interface - XTI */
/* or */
#include <tiuser.h> /* for Transport Layer Interface - TLI */
int t_rcvdis (fd, discon);
int fd;
struct t_discon *discon;
DESCRIPTION
The t_rcvdis() function is used to identify the cause of a disconnect, and to retrieve any user data
sent with the disconnect. fd identifies the local transport endpoint where the connection existed. discon
points to a
t_discon structure containing the following members:
struct netbuf udata;
int reason;
int sequence;
The type netbuf structure is defined in the <xti.h> or <tiuser.h> header file. This structure,
which is used to define buffer parameters, has the following members:
unsigned int maxlen maximum byte length of the data buffer
unsigned int len actual byte length of data written to buffer
char *buf points to buffer location
reason specifies the reason for the disconnect through a protocol-dependent reason code. For HP XTI over
the OSI transport provider, these codes are described in the OTS/9000 manual section under "Transport
Errors". For TLI, see the documentation for the transport provider being used. 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 who has executed one or more t_listen() functions and is processing the resulting con-
nect indications. If a disconnect indication occurs, sequence can be used to identify which of the outstand-
ing connect indications is associated with the disconnect.
If a user does not care that there is incoming data and does not need to know the value of reason or
sequence , discon may be a null pointer and any user data associated with the disconnect will be dis-
carded. However, if a user has retrieved more than one outstanding connect indication (via
t_listen()) and discon is a null pointer, the user will be unable to identify with which connect indica-
tion the disconnect is associated.
Valid States
T_DATAXFER, T_OUTCON, T_OUTREL, T_INREL, T_INCON (ocnt > 0)
Fork Safety
t_rcvdis is not fork-safe.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of −1 is returned and
t_errno
is set to indicate the error.
ERRORS
On failure,
t_errno is set to one of the following:
[TBADF] The specified identifier does not refer to a transport endpoint.
[TNODIS] No disconnect indication currently exists on the specified transport endpoint.
[TBUFOVFLW] The number of bytes allocated for incoming data is not sufficient to store the data. If fd
is a passive endpoint with ocnt (number of outstanding connections) > 1, it remains in
state
T_INCON (see t_getstate). Otherwise, the endpoint state is set to T_IDLE.
[TNOTSUPPORT]
This function is not supported by the underlying transport provider.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1