summaryrefslogtreecommitdiff
path: root/include/socketengines/socketengine_poll.h
diff options
context:
space:
mode:
authorpsychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-27 18:37:23 +0000
committerpsychon <psychon@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-27 18:37:23 +0000
commit5de0f22264f580c427af739185c6bab8e8d881be (patch)
tree81c03ddcce8de414e3e5b058d543f041ac4ccf1a /include/socketengines/socketengine_poll.h
parentf5e34251d3e85d1e3cee23b418dc17e4b6cca3b3 (diff)
Fix the poll socketengine to actually work.
The old implementation tried to use holes for unused entries in the array for poll() and the OS replied with POLLNVAL to which we replied with 100% CPU. Improvements: - It does compile! - It works git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11008 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include/socketengines/socketengine_poll.h')
-rw-r--r--include/socketengines/socketengine_poll.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/socketengines/socketengine_poll.h b/include/socketengines/socketengine_poll.h
index f40cecd2c..1a85cff5e 100644
--- a/include/socketengines/socketengine_poll.h
+++ b/include/socketengines/socketengine_poll.h
@@ -43,6 +43,9 @@ private:
/** These are used by poll() to hold socket events
*/
struct pollfd *events;
+ /** This map maps fds to an index in the events array.
+ */
+ std::map<int, unsigned int> fd_mappings;
public:
/** Create a new PollEngine
* @param Instance The creator of this object
@@ -52,6 +55,7 @@ public:
*/
virtual ~PollEngine();
virtual bool AddFd(EventHandler* eh);
+ virtual EventHandler* GetRef(int fd);
virtual int GetMaxFds();
virtual int GetRemainingFds();
virtual bool DelFd(EventHandler* eh, bool force = false);