错误信息
events.js:141
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:870:11)
at TCP.onread (net.js:544:26)
解决办法
增加error和close的事件监听
var ws = require("nodejs-websocket");
var fs = require("fs");
var zmqutil = require('./zmqutil')
var server = ws.createServer(function (conn) {
console.log("connection sussess");
var push = zmqutil.socket('push')
push.connect('tcp://127.0.0.1:7113')
conn.on("close", function (code, reason) {
console.log("关闭连接")
});
conn.on("error", function (code, reason) {
console.log("异常关闭")
});
......
}