好吧,我有一个游戏,它的服务器在节点 js 上运行,使用套接字 io 和 mysql 来存储用户数据。问题是我的服务器已经崩溃了两次,它给我的只是以下内容:
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m/root/node_modules/socket.io/lib/transports/jsonp-polling.js:88[0m
[36m[game.js][0m [31mthis.response.writeHead(200, {[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31m^[0m
[36m[game.js][0m [31m[0m
[36m[game.js][0m [31mTypeError: Cannot call method 'writeHead' of undefined
at JSONPPolling.doWrite (/root/node_modules/socket.io/lib/transports/jsonp-polling.js:88:17)
at JSONPPolling.write (/root/node_modules/socket.io/lib/transports/http-polling.js:132:8)
at JSONPPolling.packet (/root/node_modules/socket.io/lib/transport.js:515:15)
at JSONPPolling.error (/root/node_modules/socket.io/lib/transport.js:498:8)
at JSONPPolling.onData (/root/node_modules/socket.io/lib/transports/jsonp-polling.js:69:10)
at IncomingMessage.<anonymous> (/root/node_modules/socket.io/lib/transports/http.js:65:12)
at IncomingMessage.emit (events.js:64:17)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:127:21)
at Socket.ondata (http.js:1468:22)
at TCP.onread (net.js:374:27)[0m
Socket io 的响应头似乎有些问题,但我该如何解决这个问题?而且我还没有尝试过任何东西(因为我真的不知道从哪里开始)