by erkl · 11y ago · 0 comments
In this particular case, returning 0 doesn't necessarily indicate failure. Binding a socket to port 0 means you're asking the operating system to pick an available port for you, which one might argue is a reasonably safe default for unknown address families.
Let it crash, as close as possible to the point of origin of a problem is a very good principle.