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