1

Say one attempts to bind two sockets respectively on the two addresses "0.0.0.0:12345" and "127.0.0.1:12345".

Depending on the platforms I tested this on, the behavior changes.

On Linux, EADDRINUSE is returned for the bind that is attempted second. On Windows, no error is reported and it appears to me that the behavior is that binding on "0.0.0.0" acts like a fallback bond in case there are no other bonds active on the given port.

Is this correct?

If so, does any standard specify one or the other behavior, or is it left to the implementation to decide?

Lastly, is there any way to configure Linux so to have the same behavior as Windows, and vice-versa?

0

You must log in to answer this question.

Browse other questions tagged .