#include <tiuser.h>
t_rcvdis(fd, discon) int fd; struct t_discon *discon;
t_rcvdis() 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 defined in <nettli/tiuser.> as:
struct t_discon {
struct netbuf udata; /* user data */ int reason; /* reason code */ int sequence; /* sequence number */
};
The maxlen, len, and buf members of the netbuf structure are described in t_accept.3n reason specifies the reason for the disconnect through a protocol-dependent reason code, 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(3N) 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 NULL and any user data associated with the disconnect will be discarded. However, if a user has retrieved more than one outstanding connect indication (using t_listen.3n and discon is NULL, the user will be unable to identify with which connect indication the disconnect is associated.
t_rcvdis() returns:
[a manual with the abbreviation NETP]
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97