1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 02:29:26 +02:00

Set TCP_KEEPALIVE socket option to fix tcp_connection problem in

some network. Issue-100
This commit is contained in:
Vishal Banthia 2015-10-09 15:48:18 +09:00
parent 58e25c0f65
commit 6c741cbf4b
10 changed files with 38 additions and 25 deletions

14
lib/util/zmqutil.js Normal file
View file

@ -0,0 +1,14 @@
// ISSUE-100 (https://github.com/openstf/stf/issues/100)
// In some networks TCP Connection dies if kept idle for long.
// Setting TCP_KEEPALIVE option true, to all the zmq sockets
// won't let it die
var zmq = require('zmq')
module.exports.socket = function() {
var sock = zmq.socket.apply(zmq, arguments)
sock.setsockopt(zmq.ZMQ_TCP_KEEPALIVE, 1)
sock.setsockopt(zmq.ZMQ_TCP_KEEPALIVE_IDLE, 300000)
return sock
}