diff --git a/lib/net.js b/lib/net.js index 2e0b26a19585c2..f72a745bcc7ef3 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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++;