binding port 0 not returning found free port number #117

Open
Antigonus opened this Issue Feb 22, 2014 · 1 comment

Comments

Projects
None yet
2 participants

Unless a person is implementing a standard service one is stuck with the hazardous task of binding to a free port. Fortunately sockets provide a service for this invoked by binding to port '0'. bind then returns the free number found so that it can be given to clients.

em-websocket server is indeed grabbing the next free port when asked to use port 0, but it does not make the port used available on the API, so we have no way of telling clients where to find the service implemented with ruby-em-websocktets.

Looking at the source code it looks like the result from the bind is thrown away. Can we get the port number back please?

Collaborator

mloughran commented Feb 26, 2014

Sounds perfectly reasonable, please create a pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment