aboutsummaryrefslogtreecommitdiffstats
path: root/sockets.h
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.h')
-rw-r--r--sockets.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sockets.h b/sockets.h
index 274cf32..0dd06e2 100644
--- a/sockets.h
+++ b/sockets.h
@@ -228,8 +228,18 @@ int sock_address_get_ip( const SockAddress* a );
char* bufprint_sock_address( char* p, char* end, const SockAddress* a );
/* resolve a hostname or decimal IPv4/IPv6 address into a socket address.
- * returns 0 on success, or -1 on failure */
-int sock_address_init_resolve( SockAddress* a, const char* hostname, uint16_t port, int preferIn6 );
+ * returns 0 on success, or -1 on failure. Note that the values or errno
+ * set by this function are the following:
+ *
+ * EINVAL : invalid argument
+ * EHOSTDOWN : could not reach DNS server
+ * ENOENT : no host with this name, or host doesn't have any IP address
+ * ENOMEM : not enough memory to perform request
+ */
+int sock_address_init_resolve( SockAddress* a,
+ const char* hostname,
+ uint16_t port,
+ int preferIn6 );
/* create a new socket, return the socket number of -1 on failure */
int socket_create( SocketFamily family, SocketType type );