Skip to content

Commit 585911c

Browse files
authored
fix: keepAliveInitialDelay not taking effect (#2043)
1 parent ff3c36c commit 585911c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/connection.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class Connection extends EventEmitter {
5454

5555
// Optionally enable keep-alive on the socket.
5656
if (this.config.enableKeepAlive) {
57-
this.stream.setKeepAlive(true, this.config.keepAliveInitialDelay);
57+
this.stream.on('connect', () => {
58+
this.stream.setKeepAlive(true, this.config.keepAliveInitialDelay);
59+
});
5860
}
5961

6062
// Enable TCP_NODELAY flag. This is needed so that the network packets

0 commit comments

Comments
 (0)