AN_CONNECT_TOSOCKADDRSection: Antinat Programmer's Manual (3)
Index Return to Main Contents
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.
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.
- The proxy would not accept the authentication credentials that were supplied to it.
- The socket handle or sockaddr structure is invalid; or structures of this length are not supported by the library.
- Could not resolve proxy hostname.
- This call cannot be made on the type of socket, such as the authentication scheme required is not supported by this type of proxy, or the address type is not supported by this type of proxy.
- This call must be called without a currently open connection, binding, listening, or accepting call.
- Could not read information from the network; a network error occurred.
- The proxy failed to successfully process the connection.
Malcolm Smith <email@example.com>
Time: 14:19:43 GMT, January 09, 2005