1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #include "inspircd_config.h"
21 #include <sys/epoll.h>
24 #include <sys/types.h>
25 #include <sys/event.h>
30 #include "socketengine.h"
34 SocketEngine::SocketEngine(InspIRCd* Instance) : ServerInstance(Instance)
36 memset(ref, 0, sizeof(ref));
39 SocketEngine::~SocketEngine()
43 char SocketEngine::GetType(int fd)
45 if ((fd < 0) || (fd > MAX_DESCRIPTORS))
47 /* Mask off the top bit used for 'read/write' state */
48 return (ref[fd] & ~0x80);
51 bool SocketEngine::AddFd(int fd, bool readable, char type)
56 bool SocketEngine::HasFd(int fd)
58 if ((fd < 0) || (fd > MAX_DESCRIPTORS))
60 return (ref[fd] != 0);
63 bool SocketEngine::DelFd(int fd)
68 int SocketEngine::GetMaxFds()
73 int SocketEngine::GetRemainingFds()
78 int SocketEngine::Wait(int* fdlist)
83 std::string SocketEngine::GetName()
85 return "misconfigured";