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

Silent fail if server port is in use (EADDRINUSE) #19

Closed
albinekb opened this issue Jun 11, 2017 · 1 comment
Closed

Silent fail if server port is in use (EADDRINUSE) #19

albinekb opened this issue Jun 11, 2017 · 1 comment

Comments

@albinekb
Copy link

albinekb commented Jun 11, 2017

Hi! Cool project 😎

When i first started to play with this, couldn't get it to work. I just got "no races found in ...".
Then i checked with debug logging, and the issue was that the default port 3000 was in use.

What do you think of defaulting to a random port using get-port ?

Are there any reason you'd want to know the port?

If not, it should at least throw an error and quit if the port is in use 👍

❯ speedracer run
  ✔   0 races

  🏁   fastest  n/a
      slowest  n/a

  ⚠   No races found in perf/index.js.

✨  Done in 4.02s.

With DEBUG=*

...
  server start server +1ms
  server server error: Error: listen EADDRINUSE :::3000 +3ms
  runner-server listening on port: 3001 +1ms
  driver load file perf/index.js +40ms
  director file loaded: perf/index.js +13ms
  director no races found: perf/index.js +3s

✨  Done in 4.06s.

I can make a pr when you know how you want to solve this :)

@ngryman
Copy link
Collaborator

ngryman commented Jun 11, 2017

Hi, thanks for the feedback!

You can specify a custom port with the --port flag, so if 3000 is in use for some reason you can pick whatever you want. There is no specific reason for 3000 except some sort of convention.

Concerning get-port it's an excellent idea and I plan to use it in the next release (which will come out eventually 👻). 0.3.0 is a complete rewrite with a plugin system in its heart, so a PR for 0.2.0 would be trashed as soon as it comes out.

@ngryman ngryman closed this as completed Jun 11, 2017
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

No branches or pull requests

2 participants