DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 
(TLI/XTI)

t_rcvdis(NET)


t_rcvdis -- retrieve information from disconnect

Syntax

TLI syntax

cc . . . -lnsl

#include <sys/tiuser.h>

t_rcvdis (fd,discon) int fd; struct t_discon *discon;

XTI syntax

cc . . . -lxti

#include <xti.h>

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, and discon points to a t_discon structure containing the following members:
   struct netbuf udata;
   int reason;
   int sequence;
netbuf is described in netbuf(FP). 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 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 is discarded. However, if a user has retrieved more than one outstanding connect indication (via t_listen) and discon is NULL, the user is unable to identify with which connect indication the disconnect is associated.

Return values

t_rcvdis returns 0 on success and -1 on failure, and t_errno is set to indicate the error.

Diagnostics

On failure, t_errno may be set to one of the following:

[TBADF]
The specified file descriptor does not refer to a transport endpoint.

[TBUFOVFLW]
The number of bytes allocated for incoming data is not sufficient to store the data. The provider's state, as seen by the user, changes to T_IDLE, and the disconnect indication information to be returned in discon is discarded.

[TNODIS]
No disconnect indication currently exists on the specified transport endpoint.

[TNOTSUPPORT]
The T_CLTS service type is not supported by the underlying transport provider.

[TOUTSTATE]
The state was incorrect when this routine was called; XTI only.

[TSYSERR]
A system error occurred during execution of this function. One possibility is an I/O error indicated by errno set to EIO. Another possibility is a protocol error indicated by errno set to EPROTO.

See also

Intro(NET), netbuf(FP), t_connect(NET), t_listen(NET), t_open(NET), t_snddis(NET)

Standards conformance

t_rcvdis is conformant with:

AT&T SVID Issue 3 ;
X/Open CAE Specification, Networking Services, Issue 4, 1994. ;
and Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2) .


© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003