LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

cluster doesn't start when the port parameter of listen() is a string. #158

Open c4milo opened 13 years ago

c4milo commented 13 years ago

steps to reproduce:

  1. Just use .listen('3000') instead of .listen(3000)

expected: the service starts normally on port 3000

current result: The service doesn't start and a socket file 3000 is created in the current path.

rauchg commented 13 years ago

We should probably copy the impl of net#listen, which performs conversion.

tj commented 13 years ago

node does that? because you can use a local sock path as well as a string, maybe they parseInt and check NaN then default to a path or something :s seems a little weird, I would expect people to parseInt() if they really want a portno

rauchg commented 13 years ago

i'm guessing they do port == Number(port) first

rauchg commented 13 years ago

https://github.com/joyent/node/blob/master/lib/net_legacy.js#L580

rauchg commented 13 years ago

I can see this being useful for stuff like process.env.CLUSTER_PORT