AN_CONNECT_TOHOSTNAMESection: Antinat Programmer's Manual (3)
Index Return to Main Contents
The an_connect_tohostname(3) function is used to connect to the specified hostname at the specified port. This call should be used in preference to an_connect_tosockaddr(3) 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.
hostname is a hostname that a connection will be initiated to.
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 hostname is invalid.
- Could not resolve proxy hostname; for some types of proxy, the remote host also needs to be locally resolved, which could also generate this error.
- Could not allocate memory to translate hostname into address where the client will connect directly.
- This call cannot be made on the type of socket, or cannot return socket information for this type of connection.
- This call must be called without having performed any operation on the socket other than an_new_connection(3).
- 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