]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socketengines/socketengine_poll.cpp
m_spanningtree Allow IJOIN with lower TS
[user/henk/code/inspircd.git] / src / socketengines / socketengine_poll.cpp
index 4e6d0b9f5bf82b561f04eb36d227b919f7f4479a..5fd7e6235888f2ef91b9e38627a6b782e1d0c021 100644 (file)
  */
 
 
-#include <vector>
-#include <string>
-#include <map>
 #include "exitcodes.h"
 #include "inspircd.h"
-#include "socketengine.h"
 
 #include <sys/poll.h>
 #include <sys/resource.h>
@@ -189,7 +185,7 @@ int SocketEngine::DispatchEvents()
 
                if (revents & POLLHUP)
                {
-                       eh->HandleEvent(EVENT_ERROR, 0);
+                       eh->OnEventHandlerError(0);
                        continue;
                }
 
@@ -200,14 +196,14 @@ int SocketEngine::DispatchEvents()
                        int errcode;
                        if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &errcode, &codesize) < 0)
                                errcode = errno;
-                       eh->HandleEvent(EVENT_ERROR, errcode);
+                       eh->OnEventHandlerError(errcode);
                        continue;
                }
 
                if (revents & POLLIN)
                {
                        eh->SetEventMask(eh->GetEventMask() & ~FD_READ_WILL_BLOCK);
-                       eh->HandleEvent(EVENT_READ);
+                       eh->OnEventHandlerRead();
                        if (eh != GetRef(fd))
                                // whoops, deleted out from under us
                                continue;
@@ -221,7 +217,7 @@ int SocketEngine::DispatchEvents()
 
                        // The vector could've been resized, reference can be invalid by now; don't use it
                        events[index].events = mask_to_poll(mask);
-                       eh->HandleEvent(EVENT_WRITE);
+                       eh->eh->OnEventHandlerWrite();
                }
        }