generator icon indicating copy to clipboard operation
generator copied to clipboard

Fixes issues where Node doesn't error if port is in use.

Open bacrossland opened this issue 6 years ago • 3 comments

This fixes #206

bacrossland avatar Jul 17 '18 19:07 bacrossland

Working on a solution now. I'm going to update this PR to better describe what is happening and how the fix would solve that.

bacrossland avatar Jul 19 '18 14:07 bacrossland

After a lot of research, I have reverted part of my fix and provided a test for it. The issue that I was having is an OS specific issue. If you have IPv6 enabled it will not necessarily block IPv4 for listening. I've added a comment block to explain more what is happening incase other engineers have this issue with their app.

I've also added in a catch for an error condition that may return on Linux when kernel option ipv6.disable=1 is used. I did not force listening on IPv4 under that condition and instead opted for alerting the engineer of the issue so they can make a decision based on their environment.

Sources:

ipv6only listen/bind option https://github.com/nodejs/node/issues/17664

Why listening "::" (all IPv6) also get "0.0.0.0"(all IPv4) listened? https://github.com/nodejs/node/issues/9390

IPv6: Is ::' equivalent to 0.0.0.0' when listening for connections? https://stackoverflow.com/questions/27480094/ipv6-is-equivalent-to-0-0-0-0-when-listening-for-connections

bacrossland avatar Jul 24 '18 15:07 bacrossland

Sorry I haven't gotten back to this. I will try to get to this before the end of the month.

bacrossland avatar Dec 06 '18 16:12 bacrossland