LearnBoost / cluster

Node.JS multi-core server manager with plugins support.

Home Page:http://learnboost.github.com/cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

c4milo opened this issue · comments

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.

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

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

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

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