IPX/SPX Programming Manual
Library Routines
HP NonStop IPX/SPX Programming Manual—528022-001
5-21
connect, connect_nw
address_len
should be a value indicating the size in bytes of the IPX address data structure,
pointed to by address_ptr.
tag
is the tag parameter to be used for the nowait operation initiated by connect_nw.
Errors
If an error occurs, the external variable errno is set to one of the following values:
Usage Guidelines
•
Use connect on a socket created for waited operations, or connect_nw on a
socket created for nowait operations. The operation initiated by connect_nw must
be completed with a call to the AWAITIOX procedure.
For information on error checking, see Nowait Call Errors on page 5-5.
For information on struct sockaddr_nv and struct sockaddr, see NonStop
IPX/SPX Data Structures on page 4-2.
Example
In this example, the connect routine is called to connect the socket fd to a remote
socket. The remote socket contains the IPX address data structure of the remote
socket:
#include <socket.h>
#include <nv.h>
#include <netdb.h>
...
struct sockaddr_nv remote;
....
/* Program must contain code to create the socket fd
* before calling connect.
*/
...
remote.snv_family = AF_NV;
remote.snv_addr s_net[0] = 0x00;
remote.snv_addr.s_net[1] = 0x00;
EALREADY There is already an outstanding call on the socket.
EISCONN The specified socket was already connected.
ETIMEDOUT The connection timed out without being established.
ECONNREFUSED The remote host rejected the connection.
ENETUNREACH The network (of the remote host) was unreachable.
EINVAL One of the arguments to this call was invalid.