On Mon, Mar 14, 2022 at 11:19 AM Gary Gregory <garydgreg...@gmail.com> wrote: > Using 0 to get an ephemeral is guaranteed to work (until the OS runs out of > ports). Using AvailablePortFinder does not guarantee anything IIRC. Isn't > there a (small) chance that someone else on the machine can use that port > before we do? Assuming there is an API that says 'this is my actual port' > in the server we are creating.
There is no API to retrieve the server's actual port, but this can be done through a private field. I pushed a proof-of-concept on the `release-2.x`. Piotr