]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspsocket.h
irc::tokenstream is a token parser which using std::string and std::vector builds...
[user/henk/code/inspircd.git] / include / inspsocket.h
index 6994e1647abd88210ffdca5418343de8b0f912c0..56c04373d4aa571a5d2c4339fcf3832c287f6968 100644 (file)
@@ -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:
 
@@ -156,6 +156,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 +230,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 +306,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.
         */