This repository has been archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Cannot catch EADDRINUSE #184
Labels
exp/beginner
Can be confidently tackled by newcomers
good first issue
Good issue for new contributors
help wanted
Seeking public contribution on this issue
P2
Medium: Good to have, but can wait until someone steps up
Comments
You could use Might be a nicer approach than trying (potentially) lots of new sockets until you find a free one? |
Thank you. It would be a partial solution for my problem at hand. But in general, it would be nice to be able to at least print a human-friendly error message instead of confronting the user with some technical stack trace. |
I think this should be validated - if a port is in used the error should be catchable, it should not take the process down. From the error message the |
achingbrain
added
help wanted
Seeking public contribution on this issue
good first issue
Good issue for new contributors
exp/beginner
Can be confidently tackled by newcomers
labels
Oct 5, 2022
alanshaw/it-ws#34 should fix this but it's not working for some reason |
github-actions bot
pushed a commit
that referenced
this issue
Dec 8, 2022
## [5.0.1](v5.0.0...v5.0.1) (2022-12-08) ### Bug Fixes * cannot catch EADDRINUSE ([#198](#198)) ([c7312db](c7312db)), closes [#184](#184) ### Dependencies * **dev:** bump @libp2p/interface-mocks from 7.1.0 to 8.0.2 ([#199](#199)) ([daff533](daff533)), closes [#318](https://github.com/libp2p/js-libp2p-websockets/issues/318) [#315](https://github.com/libp2p/js-libp2p-websockets/issues/315) [#313](https://github.com/libp2p/js-libp2p-websockets/issues/313) [#312](https://github.com/libp2p/js-libp2p-websockets/issues/312) * **dev:** bump it-all from 1.0.6 to 2.0.0 ([#193](#193)) ([6213f8f](6213f8f)), closes [#28](#28) [#28](#28) [#27](#27) [#24](#24) * **dev:** bump it-drain from 1.0.5 to 2.0.0 ([#191](#191)) ([e549691](e549691)), closes [#28](#28) [#28](#28) [#27](#27) [#24](#24) * **dev:** bump it-take from 1.0.2 to 2.0.0 ([#192](#192)) ([4c037fc](4c037fc)), closes [#28](#28)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
exp/beginner
Can be confidently tackled by newcomers
good first issue
Good issue for new contributors
help wanted
Seeking public contribution on this issue
P2
Medium: Good to have, but can wait until someone steps up
Hello! I want to implement that a different port is tried automatically when the currently tried out port is in use. However, it is impossible to catch the EADDRINUSE exception when running
await node.start();
. NodeJS terminates beforenode.start()
returns a Promise.Following is output:
To me, the issue has a medium severity, because the workaround to check the port usage before is tedious, platform dependent, and cannot be reliable because it is not atomic.
Versions:
Possibly related:
The text was updated successfully, but these errors were encountered: