ReuseAddress for datagramsocket RRS feed

  • Question

  • Why isnt the socket option "reuseaddress" exposed to MetroCore?  

    I am trying to implement the standard WS-DISCOVERY protocol using the raw sockets and have everything working except I am unable to consistently bind to UDP port (servicename) 3702 for multicast as it's already in use.   

    I get that you might not want us to implement servers which would be the normal use case for reuse, but this is a standard client protocol that requires the client to listen out for HELLOs and BYEs across the network and so requires a multicast listener on a consistent port that all apps use.

    I dont think I can use the DNS SRV records in this case so am not sure I can implement this.

    Any suggestions appreciated.

    EDIT: I found a similar post in the Javascript forum


    which referred to article http://msdn.microsoft.com/en-us/library/ms740621(VS.85).aspx but this was rather unfulfilling as the article specifically states that the one legitimate use of socket re-use without security risk is specifically for multicast listeners which is exactly what I and the original javascript poster wanted to do.  They wanted to do UPNP on port 1900, which is similar enough to WS_DISCOVERY.

    Again, any workaround appreciated.

    • Edited by gphb Wednesday, March 14, 2012 2:26 AM Edited for similar post found
    Wednesday, March 14, 2012 1:38 AM


  • Hi GPHB - there isn't a workaround for this.  The security issues were a big concern.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Wednesday, March 14, 2012 7:02 PM