Python / Node ZeroRPC心跳错误

我试图从ZeroRPC 网站运行Python服务器/ node.js客户端HelloWorld示例。 所有相关的库似乎已经正确安装,但运行示例时,我得到的错误:

{ name: 'HeartbeatError', message: 'Lost remote after 10000ms', traceback: '' } 

有没有人看过这个?

我正在使用“zerorpc”:“^ 0.9.3”当我运行一个耗时的Python代码时遇到了同样的问题。 解决这个问题的方法是你需要修改zerpc的节点代码:node_modules – > zerorpc – > lib – > channel.js将cooresponding方法更改为

 //Runs the heartbeat on this channel Channel.prototype._runHeartbeat = function() { var self = this; return setInterval(function() { if(util.curTime() > self._heartbeatExpirationTime) { //If we haven't received a response in 2 * heartbeat rate, send an //error // self.emit("heartbeat-error", "Lost remote after " + (HEARTBEAT * 2) + "ms"); // self.close(); } //Heartbeat on the channel try { var event = events.create(self._envelope, self._createHeader(), "_zpc_hb", [0]); self._socket.send(event); } catch(e) { console.error("Error occurred while sending heartbeat:", e); } }, HEARTBEAT); }; 

在github的最新代码: https : //github.com/dotcloud/zerorpc-node他们已经解决了这个问题。

如果可以的话,使用gevent.sleep让zerorpc有足够的时间处理等待消息,包括心跳。