You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
It appears that there is a bug with dgram in that subsequent workers fail to bind to the specified port. I did a search and it appears that a similar bug existed in the LearnBoost/cluster project in 0.6.6; LearnBoost/cluster#129
This bug exists in 0.6.2 on OSX at least. The following is some sample code that demonstrates the problem.
varutil=require("util"),dgram=require("dgram"),cluster=require('cluster');varudp=dgram.createSocket("udp4");varport=1190;if(cluster.isMaster){for(i=0;i<2;i++){cluster.fork();}}else{util.log("starting udp server on port "+port);udp.on("error",function(error){util.log("failed to bind to UDP port - "+error)});udp.bind(port);}
Running this code you see the following:
$ node udp-cluster.js
25 Nov 23:05:53 - starting udp server on port 1190
25 Nov 23:05:53 - starting udp server on port 1190
25 Nov 23:05:53 - failed to bind to UDP port - Error: bind EADDRINUSE
It appears that there is a bug with dgram in that subsequent workers fail to bind to the specified port. I did a search and it appears that a similar bug existed in the LearnBoost/cluster project in 0.6.6; LearnBoost/cluster#129
This bug exists in 0.6.2 on OSX at least. The following is some sample code that demonstrates the problem.
Running this code you see the following: