【发布时间】:2013-09-06 12:27:02
【问题描述】:
我是 socket.io 的新手。所以我的 socket.io 服务器有时会崩溃,给出以下错误
timers.js:103
if (!process.listeners('uncaughtException').length) throw e;
^
Error: socket hang up
at createHangUpError (http.js:1360:15)
at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26)
at ServerResponse.OutgoingMessage._send (http.js:476:15)
at ServerResponse.OutgoingMessage.write (http.js:749:16)
at XHRPolling.doWrite (E:\sitesroot\0\node_modules\socket.io\lib\transports\
xhr-polling.js:67:17)
at XHRPolling.HTTPPolling.write (E:\sitesroot\0\node_modules\socket.io\lib\t
ransports\http-polling.js:132:8)
at XHRPolling.Transport.packet (E:\sitesroot\0\node_modules\socket.io\lib\tr
ansport.js:515:15)
at Object.<anonymous> (E:\sitesroot\0\node_modules\socket.io\lib\transports\
http-polling.js:79:12)
at Timer.list.ontimeout (timers.js:101:19)
它没有显示错误发生的位置或原因,因此很确定它与我编写的代码无关。可能与运输有关吗?我对它没有太多的了解。任何有关如何阻止它崩溃的建议将不胜感激。谢谢
【问题讨论】:
-
您使用的是哪个版本的节点?我强烈建议你安装最新的稳定版
-
这个错误多见于node v8.20
-
我用的是v8.20,哪个版本最稳定?我正在使用 azure node.js sdk,我在某处读到 v8.21 可能会导致 azure sdk 出现一些问题.....知道在使用 azure sdk 时应该使用哪个版本吗?
标签: node.js websocket socket.io long-polling