]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/socketengine.h
Documented all of the functions in a basic manner here. More detail to follow
[user/henk/code/inspircd.git] / include / socketengine.h
index 734aa1938a5d0f85803c07f469e862df0e19c27c..5ccfa801e7b390f6e89a76ef3f8466ad1e4b9e82 100644 (file)
@@ -35,18 +35,19 @@ const char X_LISTEN             = 1;
 const char X_ESTAB_CLIENT       = 2;
 const char X_ESTAB_MODULE       = 3;
 const char X_ESTAB_DNS          = 4;
-const char X_ESTAB_CLASSDNS    = 5;
 
 /**
  * To indicate that a socket is readable, we
  * mask its top bit with this X_READBIT value.
  * The socket engine can handle two types of
- * socket, readable and writeable (error sockets
+ * socket, readable and writeable (;error sockets
  * are dealt with when read() and write() return
  * negative or zero values).
  */
 const char X_READBIT            = 0x80;
 
+class InspIRCd;
+
 /**
  * The actual socketengine class presents the
  * same interface on all operating systems, but
@@ -55,10 +56,20 @@ const char X_READBIT            = 0x80;
  * from system to system and upon the config
  * settings chosen by the server admin. The current
  * version supports select, epoll and kqueue.
+ * The configure script will enable a socket engine
+ * based upon what OS is detected, and will derive
+ * a class from SocketEngine based upon what it finds.
+ * The derived classes file will also implement a
+ * classfactory, SocketEngineFactory, which will
+ * create a derived instance of SocketEngine using
+ * polymorphism so that the core and modules do not
+ * have to be aware of which SocketEngine derived
+ * class they are using.
  */
 class SocketEngine : public Extensible
 {
 protected:
+       InspIRCd* ServerInstance;
        int EngineHandle;                       /* Handle to the socket engine if needed */
        int CurrentSetSize;                     /* Current number of descriptors in the engine */
        char ref[MAX_DESCRIPTORS];              /* Reference table */
@@ -72,7 +83,7 @@ public:
         * epoll on a 2.4 linux kernel) then this
         * function may bail back to the shell.
         */
-       SocketEngine();
+       SocketEngine(InspIRCd* Instance);
 
        /** Destructor
         * The destructor transparently tidies up