]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socketengine.h
Reduce size of max number of bytes in a bitfield from a 4 or 8 byte field to a 1...
[user/henk/code/inspircd.git] / include / socketengine.h
index a4628b6488011f21d0c431cb2b2dbc7c00fb0f84..9b3cdec646c635b2bc0c57c490587ba055f259bf 100644 (file)
 /** Types of event an EventHandler may receive.
  * EVENT_READ is a readable file descriptor,
  * and EVENT_WRITE is a writeable file descriptor.
+ * EVENT_ERROR can always occur, and indicates
+ * a write error or read error on the socket,
+ * e.g. EOF condition or broken pipe.
  */
 enum EventType
 {
        EVENT_READ      =       0,
-       EVENT_WRITE     =       1
+       EVENT_WRITE     =       1,
+       EVENT_ERROR     =       2
 };
 
 class InspIRCd;
@@ -127,7 +131,7 @@ class EventHandler : public Extensible
         * @param et either one of EVENT_READ for read events,
         * and EVENT_WRITE for write events.
         */
-       virtual void HandleEvent(EventType et) = 0;
+       virtual void HandleEvent(EventType et, int errornum = 0) = 0;
 };
 
 /** Provides basic file-descriptor-based I/O support.