From fe4c51dbf99e3682caa239c5e0c362f639518a58 Mon Sep 17 00:00:00 2001 From: theanarkh Date: Mon, 20 Jun 2022 01:47:16 +0800 Subject: [PATCH] net: fix net.Server keepalive and noDelay --- lib/net.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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++;