Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ishitatsuyuki
Copy link
Contributor

Additionally, fix the issue where passing 0 to camp.start doesn't work.

Copy link
Collaborator

@jankeromnes jankeromnes left a 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;
Copy link
Collaborator

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;
Copy link
Collaborator

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)?

Copy link
Contributor Author

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?

Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants