Functionally I don’t think this is necessary. In the retry case, it will always yield a new port because the port was allocated right before the failed bind(). Port allocation is deterministic this way as well; expired ports will be re-used quickly.

If there’s a good reason to change this I’m happy to, I just don’t see the advantage of doing it this way at this moment, and it introduces additional complexity.