开发者

node websocket-server -- ETIMEDOUT error

开发者 https://www.devze.com 2023-04-02 03:49 出处:网络
I\'m using this with expressjs, is there a good way to catch this error: WS: 179575738318 end WS: 179575738318 stateChange:4 -> 5 WS:

I'm using this with expressjs, is there a good way to catch this error:

WS: 179575738318 end WS: 179575738318 stateChange: 4 -> 5 WS: 179575738318 socket closed WS: 179575738318 stateChange: 5 -> 6 Manager: Detached: (11) WS: 179575734517 end WS: 179575734517 stateChange: 4 -> 5 WS: 179575734517 socket closed WS: 179575734517 stateChange: 5 -> 6 Manager: Detached: (10) WS: 179575734515 error Error: ETIMEDOUT, Connection timed out

node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: ETIMEDOUT, Connection timed out 开发者_StackOverflow社区 at Socket._readImpl (net.js:163:14) at Socket._onReadable (net.js:633:22) at IOWatcher.onReadable [as callback] (net.js:177:10)

I add in this clause, so this should work?

ws.websocketServer.on('error', function (error) { console.log('Error: ' + error); });


ws.websocketServer.on('error', function (error) { console.log('Error: ' + error); }); did it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号