Manual Page Result
0
Command: t_rcvdis | Section: 3 | Source: Digital UNIX | File: t_rcvdis.3.gz
t_rcvdis(3) Library Functions Manual t_rcvdis(3)
NAME
t_rcvdis - Retrieves disconnect information
LIBRARY
XTI Library (libxti.a)
SYNOPSIS
#include <xti.h>
int t_rcvdis(
int fd,
struct t_discon *discon) ;
STANDARDS
Interfaces documented on this reference page conform to industry stan-
dards as follows:
t_rcvdis: XPG4-UNIX
Refer to the standards(5) reference page for more information about in-
dustry standards and associated tags.
PARAMETERS
The following table summarizes the relevance of input and output para-
meters before and after t_rcvdis() is called: center, tab(@); lb lb lb
l c c. Parameter@Before Call@After Call _ fd@y@n dis-
con->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:
y This is a meaningful parameter.
n This is not a meaningful parameter.
o This an optional parameter.
(o) The content of the object pointed to by y is optional.
fd Specifies a file descriptor returned by the t_open() function
that identifies the transport endpoint where a disconnect oc-
curred.
discon 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:
struct netbuf udata
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:
unsigned int maxlen
Specifies the maximum byte length of the data buffer.
unsigned int len
Specifies the actual byte length of data written to the buffer.
char *buf
Points to the buffer location.
int reason
Specifies the reason the disconnect occurred.
int sequence
Specifies the sequence number identifying an outstanding connec-
tion indication that has been disconnected. The field sequence is
only meaningful when the t_rcvdis() function is issued by a pas-
sive transport user who has issued one or more t_listen() func-
tions and is processing the resulting connect indications.
On return, the discon->udata buffer contains information associ-
ated 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 discon-
nect using a protocol-dependent reason code. When protocol inde-
pendence 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 end-
point connection (refer to the t_listen() function), the
discon->sequence parameter is used to specify the outstanding con-
nection indication with which the disconnect is associated.
When a transport user is not concerned with incoming remote trans-
port user data, with a reason for a disconnect, or with the se-
quence 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 connec-
tion indication (refer to the t_look() function), and this func-
tion is called with the discon parameter set to the null pointer
value, there is no way to identify the connection where the dis-
connect occurred.
VALID STATES
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)).
DESCRIPTION
The t_rcvdis() XTI connection-oriented function is used to identify the
cause of a disconnect at a transport endpoint specified by a file de-
scriptor returned by the t_open() function, and to retrieve any user
data sent with the disconnect.
RETURN VALUES
Upon successful completion, a value of 0 (zero) is returned. Other-
wise, a value of -1 is returned and t_errno is set to indicate the er-
ror.
ERRORS
If the t_rcvdis() function fails, t_errno is set to one of the follow-
ing values:
[TBADF] File descriptor fd does not refer to a valid transport end-
point.
[TNODIS] No disconnect indication currently exists on the transport
endpoint specified by the fd parameter.
[TBUFOVFLW]
The number of bytes allocated for incoming data is not suffi-
cient to store the data. When fd specifies a passive trans-
port endpoint (the number of outstanding connection indica-
tions is greater than 1), the transport endpoint remains in
state T_INCON; otherwise, the transport endpoint state be-
comes T_IDLE.
[TSYSERR] A system error occurred during execution of this function.
[TOUTSTATE]
The t_rcvdis() function was issued in the wrong sequence on
the transport endpoint referenced by the fd parameter.
[TNOTSUPPORT]
This function is not supported by the underlying transport
provider.
[TPROTO] 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).
RELATED INFORMATION
Functions: t_alloc(3), t_connect(3), t_listen(3), t_open(3), t_snd-
dis(3) delim off
t_rcvdis(3)