1t_rcvdis(3NSL) Networking Services Library Functions t_rcvdis(3NSL)
2
3
4
6 t_rcvdis - retrieve information from disconnection
7
9 #include <xti.h>
10
11
12
13 int t_rcvdis(int fd, struct t_discon *discon);
14
15
17 This routine is part of the XTI interfaces which evolved from the TLI
18 interfaces. XTI represents the future evolution of these interfaces.
19 However, TLI interfaces are supported for compatibility. When using a
20 TLI routine that has the same name as an XTI routine, the tiuser.h
21 header file must be used. Refer to the TLI COMPATIBILITY section for
22 a description of differences between the two interfaces.
23
24
25 This function is used to identify the cause of a disconnection and to
26 retrieve any user data sent with the disconnection. The argument fd
27 identifies the local transport endpoint where the connection existed,
28 and discon points to a t_discon structure containing the following mem‐
29 bers:
30
31 struct netbuf udata;
32 int reason;
33 int sequence;
34
35
36
37 The field reason specifies the reason for the disconnection through a
38 protocol-dependent reason code, udata identifies any user data that was
39 sent with the disconnection, and sequence may identify an outstanding
40 connection indication with which the disconnection is associated. The
41 field sequence is only meaningful when t_rcvdis() is issued by a pas‐
42 sive transport user who has executed one or more t_listen(3NSL) func‐
43 tions and is processing the resulting connection indications. If a dis‐
44 connection indication occurs, sequence can be used to identify which of
45 the outstanding connection indications is associated with the discon‐
46 nection.
47
48
49 The maxlen field of udata may be set to zero, if the user does not
50 care about incoming data. If, in addition, the user does not need to
51 know the value of reason or sequence, discon may be set to NULL and
52 any user data associated with the disconnection indication shall be
53 discarded. However, if a user has retrieved more than one outstanding
54 connection indication by means of t_listen(3NSL), and discon is a null
55 pointer, the user will be unable to identify with which connection
56 indication the disconnection is associated.
57
59 Upon successful completion, a value of 0 is returned. Otherwise, a
60 value of -1 is returned and t_errno is set to indicate an error.
61
63 T_DATAXFER, T_OUTCON, T_OUTREL, T_INREL, T_INCON(ocnt > 0).
64
66 On failure, t_errno is set to one of the following:
67
68 TBADF The specified file descriptor does not refer to a trans‐
69 port endpoint.
70
71
72 TBUFOVFLW The number of bytes allocated for incoming data (maxlen)
73 is greater than 0 but not sufficient to store the data.
74 If fd is a passive endpoint with ocnt > 1, it remains in
75 state T_INCON; otherwise, the endpoint state is set to
76 T_IDLE.
77
78
79 TNODIS No disconnection indication currently exists on the
80 specified transport endpoint.
81
82
83 TNOTSUPPORT This function is not supported by the underlying trans‐
84 port provider.
85
86
87 TOUTSTATE The communications endpoint referenced by fd is not in
88 one of the states in which a call to this function is
89 valid.
90
91
92 TPROTO This error indicates that a communication problem has
93 been detected between XTI and the transport provider for
94 which there is no other suitable XTI error (t_errno).
95
96
97 TSYSERR A system error has occurred during execution of this
98 function.
99
100
102 The XTI and TLI interface definitions have common names but use differ‐
103 ent header files. This, and other semantic differences between the two
104 interfaces are described in the subsections below.
105
106 Interface Header
107 The XTI interfaces use the header file, xti.h. TLI interfaces should
108 not use this header. They should use the header:
109 #include <tiuser.h>
110
111 Error Description Values
112 The t_errno values TPROTO and TOUTSTATE can be set by the XTI interface
113 but not by the TLI interface.
114
115
116 A failure return, and a t_errno value that this routine can set under
117 different circumstances than its XTI counterpart is TBUFOVFLW. It can
118 be returned even when the maxlen field of the corresponding buffer has
119 been set to zero.
120
122 See attributes(5) for descriptions of the following attributes:
123
124
125
126
127 ┌─────────────────────────────┬─────────────────────────────┐
128 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
129 ├─────────────────────────────┼─────────────────────────────┤
130 │MT Level │Safe │
131 └─────────────────────────────┴─────────────────────────────┘
132
134 t_alloc(3NSL), t_connect(3NSL), t_listen(3NSL), t_open(3NSL), t_snd‐
135 dis(3NSL), attributes(5)
136
137
138
139SunOS 5.11 7 May 1998 t_rcvdis(3NSL)