1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __SOCKETENGINE_EPOLL__
15 #define __SOCKETENGINE_EPOLL__
20 #include "inspircd_config.h"
22 #include "socketengine.h"
23 #include <sys/epoll.h>
26 /** A specialisation of the SocketEngine class, designed to use linux 2.6 epoll().
28 class EPollEngine : public SocketEngine
31 /** These are used by epoll() to hold socket events
33 struct epoll_event* events;
36 /** Create a new EPollEngine
39 /** Delete an EPollEngine
41 virtual ~EPollEngine();
42 virtual bool AddFd(EventHandler* eh, int event_mask);
43 virtual void OnSetEvent(EventHandler* eh, int old_mask, int new_mask);
44 virtual bool DelFd(EventHandler* eh, bool force = false);
45 virtual int DispatchEvents();
46 virtual std::string GetName();
49 /** Creates a SocketEngine
51 class SocketEngineFactory
54 /** Create a new instance of SocketEngine based on EpollEngine
56 SocketEngine* Create() { return new EPollEngine; }