gpt4 book ai didi

javascript - Node websocket-server -- ETIMEDOUT 错误

转载 作者:太空宇宙 更新时间:2023-11-04 01:16:32 31 4
gpt4 key购买 nike

我将其与expressjs一起使用,有没有好的方法来捕获此错误:

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 at Socket._readImpl (net.js:163:14) at Socket._onReadable (net.js:633:22) at IOWatcher.onReadable [as callback] (net.js:177:10)

我添加了这个子句,所以这应该有效吗?

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

最佳答案

ws.websocketServer.on('错误', function (error) { console.log('错误: ' + error); });做到了。

关于javascript - Node websocket-server -- ETIMEDOUT 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7264375/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com