Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 | both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <xti.h>
int t_rcvconnect(int fd, struct t_call *call);
Enables a calling transport user to determine the status of a previously sent connect request. t_rcvconnect() is used in conjunction with t_connect() to establish a connection in asynchronous mode. The connection will be established on successful completion of this function.
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
int sequence;
In call, addr returns
the protocol address associated with the responding transport endpoint. opt presents
any options associated with the connection. udata is meaningless
since the TCP transport provider does not support transmission of
user data during connection establishment. 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 a NULL pointer, in which case no information is given to the user on return from t_rcvconnect() . By default, t_rcvconnect() executes in synchronous mode and waits for the connection to be established before returning. On return, the addr field contains the address of the remote endpoint, and opt reflects the result of negotiation of the options the user specified on input.
If O_NONBLOCK is set (using 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 and returns immediately without waiting for the connection to be established. (See TNODATA below.) In this case, t_rcvconnect() must be called again to complete the connection establishment phase and retrieve the information returned in call.
Valid states: T_OUTCON
If successful, t_rcvconnect() returns 0.