t_rcvconnect(3) Library Functions Manual t_rcvconnect(3)
NAME
t_rcvconnect - Receives the confirmation from a connect request
LIBRARY
XTI Library (libxti.a)
SYNOPSIS
#include <xti.h>
int t_rcvconnect(
int fd,
struct t_call *call) ;
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
t_rcvconnect(): XNS4.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
The following table summarizes the relevance of input and output parameters before and after t_rcvconnect() is called:
Parameter Before Call After Call
----------------------------------------------
fd y n
call->addr.maxlen y n
call->addr.len n y
call->addr.buf o (o)
call->opt.maxlen y n
call->opt.len n y
call->opt.buf o (o)
call->udata.maxlen y n
call->udata.len n y
call->udata.buf o (o)
call->sequence n n
Notes to Table
y This is a meaningful parameter.
n This is not a meaningful parameter.
(o) The content of the object pointed to by o is optional.
(y) The content of the object pointed to by y is meaningful.
fd Specifies a file descriptor returned by the t_open() function that identifies the local transport endpoint where the connection is
to be established.
call Points to a type t_call structure, used to reserve space for a buffer that stores information associated with the connection at the
transport endpoint referenced by the fd parameter. When the call parameter is set to the null pointer value, no data is returned to
the caller. The t_call structure has the following members:
struct netbuf addr
References a buffer for protocol address information returned from the transport endpoint specified by the fd parameter. The type net-
buf 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.
struct netbuf opt
Specifies a buffer for protocol-specific parameters associated with the connection.
struct netbuf udata
Specifies a buffer for transport user data sent from the destination transport user.
int sequence
This parameter is not meaningful for the t_rcvconnect() function.
The addr parameters pointed to by the call parameter specify protocol address information associated with the responding transport
endpoint. Before this function is called, the addr.maxlen parameter must be set to specify the maximum byte length of the protocol-
address buffer pointed to by the addr.buf parameter, which is used to hold the protocol address of the responding transport endpoint.
On return, the addr.len parameter specifies the actual transport endpoint protocol-address byte length and the buffer pointed to by
addr.buf contains the transport endpoint protocol address.
The opt parameters pointed to by the call parameter specify optional information associated with the responding transport endpoint.
Before this function is called, the opt.maxlen parameter must be set to specify the maximum byte length of the options-data buffer
pointed to by the opt.buf parameter, which is used to hold optional information from the responding transport endpoint when it is pro-
vided.
On return, the opt.len parameter specifies the actual transport endpoint optional-data byte length and the data buffer pointed to by
opt.buf contains transport endpoint optional data.
The udata parameters pointed to by the call parameter specify user information associated with the responding transport endpoint.
Before this function is called, the udata.maxlen parameter must be set to specify the maximum byte length of the user-data buffer
pointed to by the udata.buf parameter, which is used to hold remote transport user information from the responding transport endpoint
when it is provided.
On return, the udata.len parameter specifies the actual transport endpoint user-data byte length and the data buffer pointed to by
udata.buf contains transport endpoint user data.
VALID STATES
The t_rcvconnect() function can only be called in the T_OUTCON transport provider state.
DESCRIPTION
The t_rcvconnect() XTI function enables a calling transport user to determine the status of a previously sent connect request at a trans-
port endpoint specified by a file descriptor returned by the t_open() function. The t_rcvconnect() function is used in conjunction with
the t_connect() function to establish a connection in asynchronous mode. By default, this function executes in synchronous mode, waiting
for the connection to be established before returning control to the caller.
However, when the transport endpoint specified by the fd file descriptor has been opened with the O_NONBLOCK flag set in the t_open() or
t_fcntl() functions, the t_connect() function executes in asynchronous mode. In asynchronous mode, when no connection confirmation is
available, control is immediately returned to the caller. In this case, t_rcvconnect() must be called again to complete the connection
establishment and retrieve the information in the call parameter.
The t_rcvconnect() function uses type t_call and netbuf structures, which are defined in the xti.h include file.
RETURN VALUE
Upon successful completion, a value of 0 (zero) is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate the
error.
ERRORS
If the t_rcvconnect() function fails, t_errno may be set to one of the following values:
[TBADF] The specified file descriptor does not refer to a transport endpoint.
[TBUFOVFLW]
The number of bytes allocated for incoming data is not sufficient for storage of that data. The connect information normally
returned to the call parameter is discarded. The transport provider state is changed to T_DATAXFER.
[TNODATA] Asynchronous mode is indicated because O_NONBLOCK was set, but no connect confirmation is currently available from the transport
provider.
[TLOOK] An asynchronous event has occurred on this transport connection and requires immediate attention (refer to the t_look() func-
tion).
[TOUTSTATE]
The function was issued in the wrong sequence on the transport endpoint referenced by the fd parameter.
[TSYSERR] A system error occurred during execution of this function.
[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_accept(3), t_alloc(3), t_bind(3), t_connect(3), t_listen(3), t_open(3), t_optmgmt(3) delim off
t_rcvconnect(3)