]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socketengine.h
Needs testbuilding in windows. I will probably do this in a minute.
[user/henk/code/inspircd.git] / include / socketengine.h
index 330e3911c5f145c9786c6cc2f24ce32c4dbf3a54..1124966568387bde492e1a5eb3cf7b5070283dc9 100644 (file)
  */
 enum EventType
 {
+       /** Read event */
        EVENT_READ      =       0,
+       /** Write event */
        EVENT_WRITE     =       1,
+       /** Error event */
        EVENT_ERROR     =       2
 };
 
@@ -139,9 +142,13 @@ class CoreExport EventHandler : public Extensible
        /** Pointer to read event. We delete this so the buffer can't be used
         * after the socket is deleted, and so it doesn't leak memory
         */
-       void * m_readEvent;
-       void * m_writeEvent;
-       void * m_acceptEvent;
+       void* m_readEvent;
+       /** Pointer to a write event.
+        */
+       void* m_writeEvent;
+       /** Pointer to an accept event.
+        */
+       void* m_acceptEvent;
 
 #endif
 };
@@ -283,6 +290,13 @@ public:
         * @return The socket engine name
         */
        virtual std::string GetName();
+
+       /** Returns true if the file descriptors in the
+        * given event handler are within sensible ranges
+        * which can be handled by the socket engine.
+        */
+       bool BoundsCheckFd(EventHandler* eh);
 };
 
 #endif
+