Closed moreirathomas closed 2 years ago
Oh sorry last suggestion: could we rename any-port
to auto-port
and default it to false
?
Up to you for the final choice on both suggestions, else you can merge directly.
Oh sorry last suggestion: could we rename
any-port
toauto-port
and default it tofalse
?Up to you for the final choice on both suggestions, else you can merge directly.
I did the renaming because I agree it is more explicit, however I chose to keep the default to true
because it is how it is meant to be use in its default usecase.
I will merge as soon as the review is green :)
I chose to keep the default to true because it is how it is meant to be use in its default usecase.
It's the default usage by the desktop app, but considering the server as a standalone it makes a bit more sense to me to use the most basic features by default 🙂
Description
Resolves the related issue by implementing the first solution suggested there. The child process (engine) finds any free port and notifies its parent of the one it found.
This allows for quicker port finding by simply asking the os (see below) instead of trying within a range and locking the port in the parent process until the child is ready to be spawned.
Finding a free port is done by asking the os for port "0", which the os interprets as "use any available port".
Pass the command line flag
--auto-port=false
to disable free port finding and instead use the port defined in.env.development
.Changes
net.ListenTCP
to read the dynamic port valueServe
to have been called to notify that the server is readyNotes
Resolves benchttp/desktop#6