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:
parent
58e25c0f65
commit
6c741cbf4b
10 changed files with 38 additions and 25 deletions
|
@ -1,7 +1,6 @@
|
|||
var zmq = require('zmq')
|
||||
|
||||
var logger = require('../../util/logger')
|
||||
var lifecycle = require('../../util/lifecycle')
|
||||
var zmqutil = require('../../util/zmqutil')
|
||||
|
||||
module.exports = function(options) {
|
||||
var log = logger.createLogger('triproxy')
|
||||
|
@ -17,18 +16,18 @@ module.exports = function(options) {
|
|||
}
|
||||
|
||||
// App/device output
|
||||
var pub = zmq.socket('pub')
|
||||
var pub = zmqutil.socket('pub')
|
||||
pub.bindSync(options.endpoints.pub)
|
||||
log.info('PUB socket bound on', options.endpoints.pub)
|
||||
|
||||
// Coordinator input/output
|
||||
var dealer = zmq.socket('dealer')
|
||||
var dealer = zmqutil.socket('dealer')
|
||||
dealer.bindSync(options.endpoints.dealer)
|
||||
dealer.on('message', proxy(pub))
|
||||
log.info('DEALER socket bound on', options.endpoints.dealer)
|
||||
|
||||
// App/device input
|
||||
var pull = zmq.socket('pull')
|
||||
var pull = zmqutil.socket('pull')
|
||||
pull.bindSync(options.endpoints.pull)
|
||||
pull.on('message', proxy(dealer))
|
||||
log.info('PULL socket bound on', options.endpoints.pull)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue