0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
705 stars 167 forks source link

Setting heartbeatInterval is not working.! #85

Closed gwthm-in closed 7 years ago

gwthm-in commented 7 years ago

I'm constructing

var zerorpc = require("zerorpc");
var client = new zerorpc.Client({heartbeatInterval: 0});
client.connect("tcp://127.0.0.1:4242");

But it seems, it has no effect?

I'm still getting.. ERROR: HeartbeatError: Lost remote after -10000ms

bombela commented 7 years ago

You are asking for a heartbeat of 0 second. zerorpc returns a Lost remote error after two missed heartbeats. Thus zerorpc waits 0*2 = 0 seconds for the server's heartbeat. Also note the heartbeat must be identical between the server and the client. Else one will think the other is not responding.

In normal operation you shouldn't need to change the default heartbeat interval.

gwthm-in commented 7 years ago

@bombela Thanks for the update.

johaven commented 5 years ago

With Python lib is possible to disable hearbeat but not in this module (0rpc/node). Is there a reason ?

Client side:

var heartbeat = options.heartbeatInterval || DEFAULT_HEARTBEAT;

Server side:

var heartbeat = heartbeat || DEFAULT_HEARTBEAT;

If we pass null value, we got the default value :(

bombela commented 5 years ago

Yeah logic in the code doesn't support this. PRs are welcome :)