-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ephemeral port for testing #71
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool trick, thanks!
Looks good to me.
var server; | ||
var portNumber = 8000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Please keep a var portNumber;
or var portNumber = 0;
here instead of relying on the portNumber = ...
above to create an accidental global.
portNumber++; | ||
serverStartDomain.run(startServer); | ||
} else { | ||
throw err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you certain that serverStartDomain
errors are automatically thrown when you don't have a .on('error', listener)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it isn't. Can we just remove the domain wrapper here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the domain's only purpose to handle EADDRINUSE? It seems like we can remove the domain altogether.
Additionally, fix the issue where passing 0 to camp.start doesn't work.