Try to write immediately after reading

This commit is contained in:
2025-08-20 14:43:01 -04:00
parent 4de9245ec7
commit e342229743

View File

@@ -338,7 +338,10 @@ void Server::start_network_threads() {
}
}
if (events[i].events & EPOLLOUT) {
// Send immediately if we already already have outgoing messages from
// read callbacks.
if ((events[i].events & EPOLLOUT) ||
((events[i].events & EPOLLIN) && conn->hasMessages())) {
bool error = conn->writeBytes();
if (error) {
continue;