Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow port=0 to let the kernel choose a random unprivileged port. #9

Merged
merged 1 commit into from Jan 11, 2012

Conversation

Projects
None yet
2 participants
Contributor

janpieper commented Jan 11, 2012

If you pass 0 as port to net.Server.listen(<port>, <host>), the kernel will choose a random and free unprivileged port. You can select the selected port with net.Server.address().port.

tj added a commit that referenced this pull request Jan 11, 2012

Merge pull request #9 from adcloud/feature/listen-on-random-port
Allow port=0 to let the kernel choose a random unprivileged port.

@tj tj merged commit 3520521 into tj:master Jan 11, 2012

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