]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspsocket.h
Remove dnsqueue
[user/henk/code/inspircd.git] / include / inspsocket.h
index 6994e1647abd88210ffdca5418343de8b0f912c0..1b9947ef9c23707770445ab1066030974b184a28 100644 (file)
@@ -20,8 +20,8 @@
 #include <sstream>
 #include <string>
 #include <deque>
-#include "inspircd_config.h"
 #include "dns.h"
+#include "inspircd_config.h"
 #include "socket.h"
 
 /**
@@ -45,7 +45,7 @@ enum InspSocketError { I_ERR_TIMEOUT, I_ERR_SOCKET, I_ERR_CONNECT, I_ERR_BIND, I
  * and use the InspSocket constructors to establish connections
  * and bindings.
  */
-class InspSocket
+class InspSocket : public Extensible
 {
 protected:
 
@@ -59,7 +59,6 @@ protected:
        /**
         * The resolver for this socket
         */
-       DNS dns;
 
        /**
         * The hostname connected to
@@ -156,6 +155,12 @@ protected:
         */
        bool ClosePending;
 
+       /** Set to true when we're waiting for a write event.
+        * If this is true and a write event comes in, we
+        * call the write instead of the read method.
+        */
+       bool WaitingForWriteEvent;
+
        bool BindAddr();
 
 public:
@@ -224,6 +229,8 @@ public:
         */
        virtual bool OnDataReady();
 
+       virtual bool OnWriteReady();
+
        /**
         * When an outbound connection fails, and the
         * attempt times out, you will receive this event.
@@ -298,6 +305,13 @@ public:
         */
        void SetState(InspSocketState s);
 
+       /**
+        * Call this to receive the next write event
+        * that comes along for this fd to the OnWriteReady
+        * method.
+        */
+       void WantWrite();
+
        /**
         * Returns the current socket state.
         */