diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 10:07:22 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-18 10:07:22 +0000 |
commit | 56cec38f3e7d3447b40076481c15e6d4a7e278d0 (patch) | |
tree | 92968b972ec14350326ad067842369cc6be7871e /src/socketengine_kqueue.cpp | |
parent | 77a4fbd1c430767beb4ae8ac1b886d66c361f60e (diff) |
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_kqueue.cpp')
-rw-r--r-- | src/socketengine_kqueue.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/socketengine_kqueue.cpp b/src/socketengine_kqueue.cpp index 14864da79..f10e6350e 100644 --- a/src/socketengine_kqueue.cpp +++ b/src/socketengine_kqueue.cpp @@ -112,17 +112,18 @@ int KQueueEngine::GetRemainingFds() return MAX_DESCRIPTORS - CurrentSetSize; } -int KQueueEngine::Wait(EventHandler** fdlist) +int KQueueEngine::DispatchEvents() { - int result = 0; - ts.tv_nsec = 5000L; ts.tv_sec = 0; int i = kevent(EngineHandle, NULL, 0, &ke_list[0], MAX_DESCRIPTORS, &ts); for (int j = 0; j < i; j++) - fdlist[result++] = ref[ke_list[j].ident]; + { + ServerInstance->Log(DEBUG,"Handle %s event on fd %d",ref[ke_list[j].ident]->Readable() ? "read" : "write", ref[ke_list[j].ident]->GetFd()); + ref[ke_list[j].ident]->HandleEvent(ref[ke_list[j].ident]->Readable() ? EVENT_READ : EVENT_WRITE); + } - return result; + return i; } std::string KQueueEngine::GetName() |