aboutsummaryrefslogtreecommitdiffstats
path: root/src/socketengine_epoll.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-08-18 10:07:22 +0000
committerGravatar brain2006-08-18 10:07:22 +0000
commit56cec38f3e7d3447b40076481c15e6d4a7e278d0 (patch)
tree92968b972ec14350326ad067842369cc6be7871e /src/socketengine_epoll.cpp
parentModified m_silence to take masks instead of nicknames. Since this is *much* m... (diff)
downloadinspircd++-56cec38f3e7d3447b40076481c15e6d4a7e278d0.tar.gz
inspircd++-56cec38f3e7d3447b40076481c15e6d4a7e278d0.tar.bz2
inspircd++-56cec38f3e7d3447b40076481c15e6d4a7e278d0.zip
Get rid of SocketEngine::Wait and array-copy, change to SocketEngine::DispatchEvents
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4944 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socketengine_epoll.cpp')
-rw-r--r--src/socketengine_epoll.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/socketengine_epoll.cpp b/src/socketengine_epoll.cpp
index 9057c6d65..be46451fa 100644
--- a/src/socketengine_epoll.cpp
+++ b/src/socketengine_epoll.cpp
@@ -111,15 +111,16 @@ int EPollEngine::GetRemainingFds()
return MAX_DESCRIPTORS - CurrentSetSize;
}
-int EPollEngine::Wait(EventHandler** fdlist)
+int EPollEngine::DispatchEvents()
{
- int result = 0;
-
int i = epoll_wait(EngineHandle, events, MAX_DESCRIPTORS, 50);
for (int j = 0; j < i; j++)
- fdlist[result++] = ref[events[j].data.fd];
+ {
+ ServerInstance->Log(DEBUG,"Handle %s event on fd %d",ref[events[j].data.fd]->Readable() ? "read" : "write", ref[events[j].data.fd]->GetFd());
+ ref[events[j].data.fd]->HandleEvent(ref[events[j].data.fd]->Readable() ? EVENT_READ : EVENT_WRITE);
+ }
- return result;
+ return i;
}
std::string EPollEngine::GetName()