登录
注册
node.js 学习社区
pm2 启动nodejs 的udp程序,无法启动,报错,node单独启动udp程序正常

kmijnuhb

2016-07-05 16:11

var dgram = require("dgram");

var server = dgram.createSocket("udp4");

server.bind(8124);



server.on("error", function (err) {

console.log("server error:\n" + err.stack);

server.close();

});


server.on("message", function (msg, rinfo) {

console.log("server got: " + msg + " from " +

rinfo.address + ":" + rinfo.port);

});


server.on("listening", function () {

var address = server.address();

console.log("server listening " +

address.address + ":" + address.port);

});





console.log('启动成功');

就这些程序,pm2 start test1.js -i 1

2016-07-05 15:39:00: û�п���ʵ����

PM2:

PM2: 2016-07-05 15:50:52: Stopping app:test1 id:0

PM2: 2016-07-05 15:51:40: Starting execution sequence in -cluster mode- for app name:test1 id:0

PM2: 2016-07-05 15:51:41: App name:test1 id:0 online

PM2: 2016-07-05 15:51:41: Error: write ENOTSUP

PM2: at exports._errnoException (util.js:1007:11)

PM2: at ChildProcess.target._send (internal/child_process.js:634:20)

PM2: at ChildProcess.target.send (internal/child_process.js:521:19)

PM2: at sendHelper (cluster.js:748:15)

PM2: at send (cluster.js:534:12)

PM2: at cluster.js:509:7

PM2: at SharedHandle.add (cluster.js:99:3)

PM2: at queryServer (cluster.js:501:12)

PM2: at Worker.onmessage (cluster.js:449:7)

PM2: at ChildProcess.<anonymous> (cluster.js:762:8)

PM2: 2016-07-05 15:51:41: App name:test1 id:0 disconnected

PM2: 2016-07-05 15:51:41: App [test1] with id [0] and pid [11552], exited with code [0] via signal [SIGTERM]

PM2: 2016-07-05 15:51:41: û�п���ʵ����

PM2:


回复 · 0

发表回复

你可以在回复中 @ 其他人