]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/socketengine_epoll.h
Much faster hash<string> for case-insensitive hashing, combined copy and lowercase...
[user/henk/code/inspircd.git] / include / socketengine_epoll.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15 */
16
17 #ifndef __SOCKETENGINE_EPOLL__
18 #define __SOCKETENGINE_EPOLL__
19
20 #include <vector>
21 #include <string>
22 #include <map>
23 #include "inspircd_config.h"
24 #include "globals.h"
25 #include "inspircd.h"
26 #include "socketengine.h"
27 #include <sys/epoll.h>
28 #define EP_DELAY 5
29
30 class EPollEngine : public SocketEngine
31 {
32 private:
33         struct epoll_event events[MAX_DESCRIPTORS];     /* Up to 64k sockets for epoll */
34 public:
35         EPollEngine();
36         virtual ~EPollEngine();
37         virtual bool AddFd(int fd, bool readable, char type);
38         virtual int GetMaxFds();
39         virtual int GetRemainingFds();
40         virtual bool DelFd(int fd);
41         virtual int Wait(int* fdlist);
42         virtual std::string GetName();
43 };
44
45 class SocketEngineFactory
46 {
47 public:
48         SocketEngine* Create() { return new EPollEngine(); }
49 };
50
51 #endif