IPX/SPX Programming Manual

Library Routines
HP NonStop IPX/SPX Programming Manual528022-001
5-20
connect, connect_nw
connect,
connect_nw
The connect and connect_nw functions connect the specified socket to a remote
socket.
For SPXII, these functions request an active connection. For IPX, they specify the
destination address for the socket.
error
is the return value. If the call is successful, a zero is returned. If the call is not
successful, -1 is returned. If the call failed, the external variable errno is set as
indicated below in “Errors”. For more details, refer to Appendix B, Socket Errors.
socket
specifies the socket number for the socket, as returned by the call to socket or
socket_nw.
address_ptr
points to the IPX address data structure of the remote socket to which a connection
is to be established.
C Synopsis
#include <socket.h>
#include <nv.h>
#include <netdb.h>
error = connect (socket, address_ptr, address_len);
error = connect_nw (socket, address_ptr, address_len, tag);
int error, socket, address_len;
struct sockaddr *address_ptr;
long tag;
TAL Synopsis
?NOLIST, SOURCE SOCKDEFT
?NOLIST, SOURCE SOCKPROC
error := connect (socket, address_ptr, address_len);
error := connect_nw (socket, address_ptr, address_len, tag);
INT socket,
address_len;
INT EXT address_ptr (sockaddr);
INT(32) tag: