Skip to content

Commit

Permalink
Set the tcp_keepalive_time to 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Oct 3, 2020
1 parent 8521c69 commit 2b57017
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/util/eventedhttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ class EventedHTTPServerConnection extends EventEmitter<Events> {
this._clientSocket.on('close', this._onClientSocketClose);
this._clientSocket.on('error', this._onClientSocketError); // we MUST register for this event, otherwise the error will bubble up to the top and crash the node process entirely.
this._clientSocket.setNoDelay(true); // disable Nagle algorithm
this._clientSocket.setKeepAlive(true);
this._clientSocket.setKeepAlive(true, 5000);

// serverSocket is our connection to our own internal httpServer
this._serverSocket = null; // created after httpServer 'listening' event
Expand Down Expand Up @@ -468,7 +468,6 @@ class EventedHTTPServerConnection extends EventEmitter<Events> {
this._serverSocket.on('error', this._onServerSocketError); // we MUST register for this event, otherwise the error will bubble up to the top and crash the node process entirely.

this._serverSocket.setNoDelay(true); // disable Nagle algorithm
this._serverSocket.setKeepAlive(true);
}

// Called only once right after onHttpServerListening
Expand Down

0 comments on commit 2b57017

Please sign in to comment.