You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If setKeepAlive() is called on a tcp socket before the connect event, then the initialDelay parameter is ignored.
This bug was alread reported here for version 0.12, but it still seems to be there in 13.7.
If, for instance, I call setKeepAlive(true, 10000) before the connect event, the default initialDelay of 7200s is used. netstat -ntp --timers gives:
tcp 0 0 10.10.15.220:56866 10.10.15.148:6666 ESTABLISHED 132820/node keepalive (7132.09/0/0)
The text was updated successfully, but these errors were encountered:
Confirmed this still behaves this way. In this example, Wireshark shows the first keepalive packet going out 60 seconds after the connection is established.
constnet=require('net');letsocket=net.createConnection({host: 'localhost',port: 31337});socket.setKeepAlive(true,1000);socket.on('connect',()=>{console.log('socket is connected');});
Moving the setKeepAlive call into the connect handler causes them to go out every 1s, as intended. If there is no intention to modify this behavior, this should at least be noted in the documentation.
If
setKeepAlive()
is called on a tcp socket before theconnect
event, then theinitialDelay
parameter is ignored.This bug was alread reported here for version 0.12, but it still seems to be there in 13.7.
If, for instance, I call
setKeepAlive(true, 10000)
before theconnect
event, the default initialDelay of 7200s is used.netstat -ntp --timers
gives:The text was updated successfully, but these errors were encountered: