2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Portions Copyright 1989 AT&T
44 .\" Copyright 1994, The X/Open Company Ltd. All Rights Reserved.
45 .\" Portions Copyright (c) 1998, Sun Microsystems, Inc. , All Rights Reserved
47 .TH T_ACCEPT 3NSL "May 1, 1998"
49 t_accept \- accept a connection request
58 \fBint\fR \fBt_accept\fR(\fBint\fR \fIfd\fR, \fBint\fR \fIresfd\fR, \fBconst struct t_call *\fR\fIcall\fR);
64 This routine is part of the \fBXTI\fR interfaces that evolved from the
65 \fBTLI\fR interfaces. \fBXTI\fR represents the future evolution of these
66 interfaces. However, \fBTLI\fR interfaces are supported for compatibility. When
67 using a \fBTLI\fR routine that has the same name as an \fBXTI\fR routine, a
68 different header file, \fBtiuser.h\fR, must be used. Refer to the \fBTLI\fR
69 \fBCOMPATIBILITY\fR section for a description of differences between the two
73 This function is issued by a transport user to accept a connection request.
74 The parameter \fIfd\fR identifies the local transport endpoint where the
75 connection indication arrived; \fIresfd\fR specifies the local transport
76 endpoint where the connection is to be established, and \fIcall\fR contains
77 information required by the transport provider to complete the connection. The
78 parameter \fIcall\fR points to a \fBt_call\fR structure which contains the
92 In \fIcall\fR, \fIaddr\fR is the protocol address of the calling transport
93 user, \fIopt\fR indicates any options associated with the connection,
94 \fIudata\fR points to any user data to be returned to the caller, and
95 \fIsequence\fR is the value returned by \fBt_listen\fR(3NSL) that uniquely
96 associates the response with a previously received connection indication. The
97 address of the caller, \fIaddr\fR may be null (length zero). Where \fIaddr\fR
98 is not null then it may optionally be checked by XTI.
101 A transport user may accept a connection on either the same, or on a different,
102 local transport endpoint than the one on which the connection indication
103 arrived. Before the connection can be accepted on the same endpoint
104 (\fIresfd==fd\fR), the user must have responded to any previous connection
105 indications received on that transport endpoint by means of \fBt_accept()\fR or
106 \fBt_snddis\fR(3NSL). Otherwise, \fBt_accept()\fR will fail and set
107 \fBt_errno\fR to \fBTINDOUT\fR.
110 If a different transport endpoint is specified (\fIresfd!=fd\fR), then the user
111 may or may not choose to bind the endpoint before the \fBt_accept()\fR is
112 issued. If the endpoint is not bound prior to the \fBt_accept()\fR, the
113 endpoint must be in the \fBT_UNBND\fR state before the \fBt_accept()\fR is
114 issued, and the transport provider will automatically bind it to an address
115 that is appropriate for the protocol concerned. If the transport user chooses
116 to bind the endpoint it must be bound to a protocol address with a \fIqlen\fR
117 of zero and must be in the \fBT_IDLE\fR state before the \fBt_accept()\fR is
121 Responding endpoints should be supplied to \fBt_accept()\fR in the state
125 The call to \fBt_accept()\fR may fail with t_errno set to \fBTLOOK\fR if there
126 are indications (for example connect or disconnect) waiting to be received on
127 endpoint \fIfd\fR. Applications should be prepared for such a failure.
130 The \fIudata\fR argument enables the called transport user to send user data to
131 the caller and the amount of user data must not exceed the limits supported by
132 the transport provider as returned in the \fIconnect\fR field of the \fIinfo\fR
133 argument of \fBt_open\fR(3NSL) or \fBt_getinfo\fR(3NSL). If the \fIlen\fR field
134 of \fIudata\fR is zero, no data will be sent to the caller. All the
135 \fImaxlen\fR fields are meaningless.
138 When the user does not indicate any option (\fIcall\(->opt.len\fR = 0) the
139 connection shall be accepted with the option values currently set for the
140 responding endpoint \fIresfd\fR.
144 Upon successful completion, a value of \fB0\fR is returned. Otherwise, a
145 value of -1 is returned and \fBt_errno\fR is set to indicate an error.
152 \fBresfd (fd!=resfd): T_IDLE, T_UNBND\fR
156 On failure, \fBt_errno\fR is set to one of the following:
163 The user does not have permission to accept a connection on the responding
164 transport endpoint or to use the specified options.
173 The specified protocol address was in an incorrect format or contained illegal
183 The amount of user data specified was not within the bounds allowed by the
193 The file descriptor \fIfd\fR or \fIresfd\fR does not refer to a transport
203 The specified options were in an incorrect format or contained illegal
213 Either an invalid sequence number was specified, or a valid sequence number was
214 specified but the connection request was aborted by the peer. In the latter
215 case, its \fBT_DISCONNECT\fR event will be received on the listening endpoint.
224 The function was called with \fIfd==resfd\fR but there are outstanding
225 connection indications on the endpoint. Those other connection indications
226 must be handled either by rejecting them by means of \fBt_snddis\fR(3NSL) or
227 accepting them on a different endpoint by means of \fBt_accept\fR.
236 An asynchronous event has occurred on the transport endpoint referenced by
237 \fIfd\fR and requires immediate attention.
243 \fB\fBTNOTSUPPORT\fR\fR
246 This function is not supported by the underlying transport provider.
252 \fB\fBTOUTSTATE\fR\fR
255 The communications endpoint referenced by \fIfd\fR or \fIresfd\fR is not in
256 one of the states in which a call to this function is valid.
265 This error indicates that a communication problem has been detected between XTI
266 and the transport provider for which there is no other suitable XTI error
273 \fB\fBTPROVMISMATCH\fR\fR
276 The file descriptors \fIfd\fR and \fIresfd\fR do not refer to the same
286 This transport provider requires both \fIfd\fR and \fIresfd\fR to be bound to
287 the same address. This error results if they are not.
296 The endpoint referenced by \fIresfd\fR (where \fIresfd\fR != \fIfd\fR) was
297 bound to a protocol address with a \fIqlen\fR that is greater than zero.
306 A system error has occurred during execution of this function.
309 .SH TLI COMPATIBILITY
312 The \fBXTI\fR and \fBTLI\fR interface definitions have common names but use
313 different header files. This, and other semantic differences between the two
314 interfaces are described in the subsections below.
315 .SS "Interface Header"
318 The \fBXTI\fR interfaces use the header file, \fBxti.h\fR. \fBTLI\fR interfaces
319 should \fInot\fR use this header. They should use the header:
327 .SS "Error Description Values"
330 The \fBt_errno\fR values that can be set by the \fBXTI\fR interface and cannot
331 be set by the \fBTLI\fR interface are:
353 \fB\fBTPROVMISMATCH\fR \fR
362 \fB\fBTRESADDR\fR \fR
371 \fB\fBTRESQLEN\fR \fR
380 The format of the options in an \fBopt\fR buffer is dictated by the transport
381 provider. Unlike the \fBXTI\fR interface, the \fBTLI\fR interface does not
382 specify the buffer format.
386 See \fBattributes\fR(5) for descriptions of the following attributes:
394 ATTRIBUTE TYPE ATTRIBUTE VALUE
402 \fBt_connect\fR(3NSL), \fBt_getinfo\fR(3NSL), \fBt_getstate\fR(3NSL),
403 \fBt_listen\fR(3NSL), \fBt_open\fR(3NSL), \fBt_optmgmt\fR(3NSL),
404 \fBt_rcvconnect\fR(3NSL), \fBt_snddis\fR(3NSL), \fBattributes\fR(5)
408 There may be transport provider-specific restrictions on address binding.
411 Some transport providers do not differentiate between a connection indication
412 and the connection itself. If the connection has already been established
413 after a successful return of \fBt_listen\fR(3NSL), \fBt_accept()\fR will assign
414 the existing connection to the transport endpoint specified by \fIresfd\fR.