an_connect_tosockaddr - connect to an outgoing address
#include <antinat.h>
int an_connect_tosockaddr(ANCONN s, struct sockaddr *address, int length);
The an_connect_tosockaddr(3) function is used to connect to the specified address at the specified port. an_connect_tohostname(3) should be used in preference to this function, because it allows name resolution to be deferred to the proxy where possible.
s is a socket previously created with an_new_connection(3) call.
address is a filled out sockaddr structure, containing an address family, address, and port that a connection should be made to. This can also be a typecast sockaddr_in6 structure, if Antinat has been compiled with IPv6 support.
length is the length of the sockaddr structure, as determined by sizeof.
Although there is planned support for non-blocking sockets in a future release, this call should be considered a blocking call. A non-blocking socket will be silently (and temporarily) changed to a blocking one to process the connection.
This call returns AN_ERROR_SUCCESS to indicate successful completion.
an_close(3), an_connect_tohostname(3) an_new_connection(3)
Malcolm Smith <malxau@users.sourceforge.net>