cluster doesn't start when the port parameter of listen() is a string.
c4milo opened this issue · comments
Camilo Aguilar commented
steps to reproduce:
- 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.
Guillermo Rauch commented
We should probably copy the impl of net#listen, which performs conversion.
TJ Holowaychuk commented
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
Guillermo Rauch commented
i'm guessing they do port == Number(port) first
Guillermo Rauch commented
I can see this being useful for stuff like process.env.CLUSTER_PORT