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 #ifndef __SOCKETENGINE_SELECT__
18 #define __SOCKETENGINE_SELECT__
23 #include "inspircd_config.h"
26 #include "socketengine.h"
28 class SelectEngine : public SocketEngine
31 std::map<int,int> fds; /* List of file descriptors being monitored */
32 fd_set wfdset, rfdset; /* Readable and writeable sets for select() */
35 virtual ~SelectEngine();
36 virtual bool AddFd(int fd, bool readable, char type);
37 virtual int GetMaxFds();
38 virtual int GetRemainingFds();
39 virtual bool DelFd(int fd);
40 virtual int Wait(int* fdlist);
41 virtual std::string GetName();
44 class SocketEngineFactory
47 SocketEngine* Create() { return new SelectEngine(); }