summaryrefslogtreecommitdiff
path: root/src/network/poller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/poller.cpp')
-rw-r--r--src/network/poller.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/poller.cpp b/src/network/poller.cpp
index 75e7e6a..010dd58 100644
--- a/src/network/poller.cpp
+++ b/src/network/poller.cpp
@@ -155,13 +155,15 @@ int Poller::poll(const std::chrono::milliseconds& timeout)
else if (this->fds[i].revents & POLLIN)
{
auto socket_handler = this->socket_handlers.at(this->fds[i].fd);
- socket_handler->on_recv();
+ if (socket_handler->is_connected())
+ socket_handler->on_recv();
nb_events--;
}
else if (this->fds[i].revents & POLLOUT)
{
auto socket_handler = this->socket_handlers.at(this->fds[i].fd);
- socket_handler->on_send();
+ if (socket_handler->is_connected())
+ socket_handler->on_send();
nb_events--;
}
}