Skip to content

Commit

Permalink
net: fix net.Server keepalive and noDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
theanarkh committed Jun 19, 2022
1 parent 8db79cc commit fe4c51d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -1659,12 +1659,11 @@ function onconnection(err, clientHandle) {
writable: true
});

if (self.noDelay && handle.setNoDelay) {
handle.setNoDelay(true);
if (self.noDelay && clientHandle.setNoDelay) {
clientHandle.setNoDelay(true);
}

if (self.keepAlive && self.setKeepAlive) {
handle.setKeepAlive(true, handle.keepAliveInitialDelay);
if (self.keepAlive && clientHandle.setKeepAlive) {
clientHandle.setKeepAlive(true, self.keepAliveInitialDelay);
}

self._connections++;
Expand Down

0 comments on commit fe4c51d

Please sign in to comment.