t_rcvdis(3)
NAME
t_rcvdis − retrieve information from disconnect
SYNOPSIS
#include <xti.h> (for XTI)
or
#include <tiuser.h> (for TLI)
int t_rcvdis (fd, discon)
int fd;
struct t_discon *discon;
DESCRIPTION
This 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, and 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, and 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(3) functions and is processing the resulting connect indications. If a disconnect indication occurs, sequence 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 reason or sequence, discon may be a null pointer 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 (3)) and discon is a null pointer, the user will be unable to identify with which connect indication the disconnect is associated.
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.
[TOUTSTATE] (XTI only) This function was issued in the wrong sequence on the transport endpoint referenced by fd.
[TSYSERR] A system error has occurred during execution of this function.
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.
NOTE
In HP-UX 9.0, XTI (X/Open Transport Interface) supports only OSI as a transport provider, and is available only as part of the OSI Transport Services 9000 product. Users of this product can access XTI versions of the t_* routines by linking with /usr/lib/libxti.a. For more information on XTI, see "HP-UX/9000 XTI Programmer’s Guide".
In HP-UX 9.0, TLI (Transport Layer Interface) supports any transport provider which is compliant with TPI (Transport Provider Interface). TLI is available only as part of the STREAMS product. Users of this product can access TLI versions of the t_* routines by linking with /usr/lib/libnsl_s.a. For more information on TLI, see the TLI section of "STREAMS/UX for HP 9000 Reference Manual".
SEE ALSO
t_alloc(3), t_connect(3), t_listen(3), t_open(3), t_snddis(3).
Hewlett-Packard Company — HP-UX Release 9.0: October 1992