Winsock: Strange conflict with SO_REUSEADDR


  • Hello!  I have faced with a strange behavior.

    The manual claimed: "When two sockets are bound to the same port number but on different explicit interfaces, there is no conflict".
    Why the system fails in the following case on the step 3?

    Step 1. process A binds the (default) — OK
    Step 2. process B binds the (with SO_REUSEADDR) — OK
    Step 3. process C binds the (with SO_REUSEADDR) — fail (10013 WSAEACCES)

    Note: the tcp-ports are the same, the interfaces are different and explicit (between step 1 and 2-3). User is the same.
    The problem occurs in the Windows Vista (32-bit), Windows Server 2008 (32-bit), Window Server 2008 R2 (64-bit), etc.

    In Windows XP it is all right: step 3 succeeds.

    • Edited by tecrothan Wednesday, June 27, 2012 5:53 PM minor correction
    Thursday, June 21, 2012 12:42 AM