我开发了一个基于节点的TCP服务器应用程序,但是这个应用程序在一段时间后崩溃,只要有人连接并在端口上发送数据,我就使用winston进行了堆栈跟踪:
{
"process": {
"pid": 28214,
"uid": 0,
"gid": 0,
"cwd": "/home/ec2-user",
"execPath": "/home/ec2- user/node/out/Release/node",
"version": "v0.6.10",
"argv": [
"node",
"/home/ec2-user/Node_TcpServer.js"
],
"memoryUsage": {
"rss": 12144640,
"heapTotal": 5274304,
"heapUsed": 3318328
}
},
"os": {
"loadavg": [
0.0029296875,
0.0146484375,
0.04541015625
],
"uptime": 779924.506942403
},
"trace": [
{
"column": 11,
"file": "net.js",
"function": "errnoException",
"line": 642,
"method": null,
"native": false
},
{
"column": 18,
"file": "[as oncomplete] (net.js",
"function": "Object.afterWrite",
"line": 480,
"method": "afterWrite",
"native": false
}
],
"stack": [
"Error: write Unknown system errno 5",
" at errnoException (net.js:642:11)",
" at Object.afterWrite [as oncomplete] (net.js:480:18)"
],
"level": "error",
"message": "uncaughtException"
}
{"process":{"pid":28214,"uid":0,"gid":0,"cwd":"/home/ec2-user","execPath":"/home/ec2-user/node/out/Release/node","version":"v0.6.10","argv":["node","/home/ec2-user/Node_TcpServer.js"],"memoryUsage":{"rss":12230656,"heapTotal":5274304,"heapUsed":3470656}},"os":{"loadavg":[0.0029296875,0.0146484375,0.04541015625],"uptime":779924.509452039},"trace":[{"column":11,"file":"net.js","function":"errnoException","line":642,"method":null,"native":false},{"column":18,"file":"[as oncomplete] (net.js","function":"Object.afterWrite","line":480,"method":"afterWrite","native":false}],"stack":["Error: write Unknown system errno 5"," at errnoException (net.js:642:11)"," at Object.afterWrite [as oncomplete] (net.js:480:18)"],"level":"error","message":"uncaughtException"} "