Skip to content

Commit 81d8be7

Browse files
committed
[refactoring][QotdConnectedHandler]: Remove redundant keep-alive and Nagle's algorithm configuration from QOTD connection.
- A connection to the QOTD server only receives data, and the server closes the connection after transmission. - No need to configure keep-alive or Nagle's algorithm for this connection. - Simplified QotdConnectedHandler to reflect protocol requirements. Signed-off-by: Goran Mišković <[email protected]>
1 parent 31aa5db commit 81d8be7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/QotdConnectedHandler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ namespace e5 {
3636
* like printing.
3737
*/
3838
void QotdConnectedHandler::onWork() {
39-
// Configure connection parameters
40-
m_io.keepAlive();
41-
m_io.setNoDelay(true); // Disable Nagle's algorithm for lower latency
39+
// No need to configure keep-alive or Nagle's algorithm for QOTD connection
40+
// (keep-alive is disabled by default, and there are no writes)
4241

4342
auto notify_connect = std::make_unique<std::string>(
4443
std::string("QOTD client connected. Local IP: ")

0 commit comments

Comments
 (0)