summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-02 17:51:06 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-02 17:51:06 +0000
commitb7d36f5296c1918d65da0d667811b9073b037077 (patch)
tree83cffa9950a705dd179eee51a7f56120a4343bf9
parentb145f922e0571dee3690b6886e59bc6ce7f1fb15 (diff)
Extra comments re. nonblocking DNS and use of IP addresses in constructor to speed up connect time
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3022 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/socket.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/socket.h b/include/socket.h
index dcaca13db..43ed322bc 100644
--- a/include/socket.h
+++ b/include/socket.h
@@ -165,8 +165,10 @@ public:
/**
* This constructor is used to create a new
- * socket, either listening for connections,
- * or an outbound connection to another host.
+ * socket, either listening for connections, or an outbound connection to another host.
+ * Note that if you specify a hostname in the 'host' parameter, then there will be an extra
+ * step involved (a nonblocking DNS lookup) which will cause your connection to be established
+ * slower than if it was an IP. Therefore, use an IP address where it is available instead.
* @param host The hostname to connect to, or bind to
* @param port The port number to connect to, or bind to
* @param listening true to listen on the given host:port pair, or false to connect to them
@@ -212,9 +214,13 @@ public:
/**
* When an outbound connection fails, and the
* attempt times out, you will receive this event.
- * The mthod will trigger once maxtime secons are
+ * The method will trigger once maxtime seconds are
* reached (as given in the constructor) just
* before the socket's descriptor is closed.
+ * A failed DNS lookup may cause this event if
+ * the DNS server is not responding, as well as
+ * a failed connect() call, because DNS lookups are
+ * nonblocking as implemented by this class.
*/
virtual void OnTimeout();