*
* AsyncSocket_Connect --
*
- * AsyncSocket AF_INET constructor. This is just a wrapper for ConnectIP
- * that does hostname -> IP address lookup.
+ * AsyncSocket AF_INET/AF_INET6 constructor. This is just a wrapper for
+ * ConnectIP that does hostname -> IP address lookup.
*
* NOTE: This function can block.
*
*/
AsyncSocket *
-AsyncSocket_Connect(const char *hostname,
+AsyncSocket_Connect(int socketFamily,
+ const char *hostname,
unsigned short port,
AsyncSocketConnectFn connectFn,
void *clientData,
* Resolve the hostname. Handles dotted decimal strings, too.
*/
- getaddrinfoError = AsyncSocketResolveAddr(hostname, port, AF_INET,
+ getaddrinfoError = AsyncSocketResolveAddr(hostname, port, socketFamily,
SOCK_STREAM, &addr, &ipString);
if (0 != getaddrinfoError) {
Log(ASOCKPREFIX "Failed to resolve address '%s' and port %u\n",
/*
* Connect to address:port and fire callback with new asock
*/
-AsyncSocket *AsyncSocket_Connect(const char *hostname,
+AsyncSocket *AsyncSocket_Connect(int socketFamily,
+ const char *hostname,
unsigned short port,
AsyncSocketConnectFn connectFn,
void *clientData,
AsyncSocketPollParams *pollParams,
int *outError);
#endif
-AsyncSocket *AsyncSocket_ConnectWebSocket(const char *url,
+AsyncSocket *AsyncSocket_ConnectWebSocket(int socketFamily,
+ const char *url,
Bool permitUnverifiedSSL,
const char *cookies,
AsyncSocketConnectFn connectFn,