diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-04-12 16:20:13 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-04-12 16:20:13 +0200 |
commit | 612384b3d46d06eea6fd71ee6dc60471d0f9e3d1 (patch) | |
tree | f9926b5ca8841a30c3a16916116a7d4102e91c31 /src/socketengine.cpp | |
parent | e3303330f8cc04121907715d789370f492878646 (diff) |
Dispatch EventHandler events to dedicated virtual functions
Remove enum EventType
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r-- | src/socketengine.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index eadfc73d3..4183488b7 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -53,6 +53,14 @@ void EventHandler::SetFd(int FD) this->fd = FD; } +void EventHandler::OnEventHandlerWrite() +{ +} + +void EventHandler::OnEventHandlerError(int errornum) +{ +} + void SocketEngine::ChangeEventMask(EventHandler* eh, int change) { int old_m = eh->event_mask; @@ -91,9 +99,9 @@ void SocketEngine::DispatchTrialWrites() int mask = eh->event_mask; eh->event_mask &= ~(FD_ADD_TRIAL_READ | FD_ADD_TRIAL_WRITE); if ((mask & (FD_ADD_TRIAL_READ | FD_READ_WILL_BLOCK)) == FD_ADD_TRIAL_READ) - eh->HandleEvent(EVENT_READ, 0); + eh->OnEventHandlerRead(); if ((mask & (FD_ADD_TRIAL_WRITE | FD_WRITE_WILL_BLOCK)) == FD_ADD_TRIAL_WRITE) - eh->HandleEvent(EVENT_WRITE, 0); + eh->OnEventHandlerWrite(); } } |