1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
14 #ifndef __SOCKETENGINE_PORTS__
15 #define __SOCKETENGINE_PORTS__
18 # error You need Solaris 10 or later to make use of this code.
24 #include "inspircd_config.h"
27 #include "socketengine.h"
32 /** A specialisation of the SocketEngine class, designed to use solaris 10 I/O completion ports
34 class PortsEngine : public SocketEngine
37 /** These are used by epoll() to hold socket events
39 port_event_t events[MAX_DESCRIPTORS];
41 /** Create a new PortsEngine
42 * @param Instance The creator of this object
44 PortsEngine(InspIRCd* Instance);
45 /** Delete a PortsEngine
47 virtual ~PortsEngine();
48 virtual bool AddFd(EventHandler* eh);
49 virtual int GetMaxFds();
50 virtual int GetRemainingFds();
51 virtual bool DelFd(EventHandler* eh, bool force = false);
52 virtual int DispatchEvents();
53 virtual std::string GetName();
54 virtual void WantWrite(EventHandler* eh);
57 /** Creates a SocketEngine
59 class SocketEngineFactory
62 /** Create a new instance of SocketEngine based on PortsEngine
64 SocketEngine* Create(InspIRCd* Instance) { return new PortsEngine(Instance); }