Try to write immediately after reading
This commit is contained in:
@@ -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();
|
bool error = conn->writeBytes();
|
||||||
if (error) {
|
if (error) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user