News for hackers. Stuff that matters.
Re:Port 0: The Port That Does Not Exist by _flux on Saturday November 07, 2026 @10:29AM (#50405365)
I'm not quite sure what a script assigning ports actually does, but if I need an app to bind a port in some port range, I just start binding ports starting from 30000 until it succeeds.

If it's in a script then that might be difficult, but a racy approximation could be to loop e.g. listening socat with different ports for finding the free port. (Or maybe: parse output of ss.) But if the port use is separate from the port binding, then it might still be busy once the time to rebind it comes.

There are no comments on this comment yet.