tj / axon

message-oriented socket library for node.js heavily inspired by zeromq
MIT License
1.5k stars 155 forks source link

Allow port numbers passed to .bind() and .connect() to be strings #129

Closed sethkinast closed 10 years ago

sethkinast commented 10 years ago

My team is doing some IPC stuff where we spawn child processes with arguments telling them what port to connect on. If the port number given to .bind() or .connect() is a string like "3000", you get ECONNREFUSED when url.parse() tries to run over "3000".

Simple patch attached to see if the port is a number before trying to parse out a hostname and port from it. Test case added as well.

Thanks for the work you do!

tj commented 10 years ago

ah yea that's annoying, we do support this notation though sock.bind('tcp://0.0.0.0:3000') so I'd just concat there then you're safe