t_rcvconnect(3xti)
t_rcvconnect --
receive the confirmation from a connect request
Synopsis
cc [options] file -lnsl
#include <xti.h>
int t_rcvconnect(int fd, struct t_call call)
Description
This function is a routine for establishing a transport connection.
t_rcvconnect enables a calling transport user to determine
the status of a connect request that it issued
to a responding transport endpoint.
On successful completion of t_rcvconnect, the connection
is initiated with an asynchronous t_connect is established.
By default, t_rcvconnect executes in synchronous mode and
waits for the connection to be established before returning.
fd
identifies the responding transport endpoint, and on return call
contains information associated with the newly established connection.
Parameters
fd-
the file descriptor for the transport endpoint where communication
will be established.
call-
points to the t_call structure used to identify
the transport user that will receive the connection indication.
Structure definitions
The call argument
points to a t_call structure which contains the following members:
struct netbuf addr; /* address */
struct netbuf opt; /* options */
struct netbuf udata; /* user data */
int sequence; /* sequence number */
netbuf
is described in
intro(3xti).
In call, addr
returns the protocol address
associated with the responding transport endpoint, opt
presents any protocol-specific information associated with
the connection, udata
points to optional user data that
may be returned by the destination transport user during connection
establishment, and sequence
has no meaning for this function.
The maxlen
field of each argument must be set before
issuing this function to indicate the maximum size of the buffer
for each. However, call may be NULL, in which case no
information is given to the user on return from t_rcvconnect.
On return, the addr
, opt
, and udata
fields reflect values associated with the connection.
If O_NONBLOCK is set (via t_open or fcntl),
t_rcvconnect executes in asynchronous mode, and reduces to a
poll for existing connect confirmations. If none are available,
t_rcvconnect fails on a TNODATA error and returns
immediately without waiting for the connection to be established.
State transitions
On entry, T_OUTCON; T_DATAXFER (successful)
or T_OUTCON (failed) on exit.
Files
/usr/lib/libxti.so-
X/Open® Transport Interface Library (shared object)
/usr/lib/libnsl.so-
Network Services Library (shared object)
Usage
A subsequent call to t_rcvconnect is required
to complete the connection establishment phase and
retrieve the information returned in call.
Return values
t_rcvconnect returns 0 on success and -1 on failure and
t_errno is set to indicate the error.
Errors
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 (
maxlen
) allocated for an incoming argument
is greater than zero but not sufficient to store the value of that argument.
The connect information to be returned in call
will be discarded.
The provider's state, as seen by the user, will be changed to
DATAXFER.
TNODATA-
O_NONBLOCK was set, but a connect confirmation has not yet arrived.
TLOOK-
An asynchronous event has occurred on the transport connection
specified by fd and requires immediate attention.
TNOTSUPPORT-
This function is not supported by the underlying transport
provider.
TSYSERR-
A system error has occurred during execution of this function.
TOUTSTATE-
The function was issued in the wrong sequence
on the transport endpoint referenced by fd.
TPROTO-
A communication problem has been detected with the transport provider
and there is no other value of t_errno to describe
the error condition.
References
fcntl(2),
intro(3xti),
t_accept(3xti),
t_bind(3xti),
t_connect(3xti),
t_listen(3xti),
t_open(3xti),
t_optmgmt(3xti)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004