locked
UDP multicast not triggering MessageReceived on port 3702 (WS-Discovery) RRS feed

  • Question

  • I am trying to put together a WS-Discovery routine in a C#/Metro app. So far, I have been able to multicast a Probe packet. Network Monitor shows that the packet is sent, identifies it correctly as WS-Discovery. Network Monitor also shows that several WSD devices are responding with a ProbeMatches packet. I am able to bind service name to 3702, not getting an error.

    But, the MessageReceived function is never triggered.

    Have I missed anything on setting up the port, or am I running afoul of ReuseAddress? Not seeing any errors, HandleSocketReceive is just never getting called. I've also tried ConnectAsync, same results.

               MyHost = new HostName("239.255.255.250");
    
                DatagramSocket TestSocket = new DatagramSocket();
                TestSocket.MessageReceived += new Windows.Foundation.TypedEventHandler<DatagramSocket,DatagramSocketMessageReceivedEventArgs> (HandleSocketReceive);
    
                await TestSocket.BindServiceNameAsync("3702");
             
                TestSocket.JoinMulticastGroup(MyHost);
    
    
    
            void HandleSocketReceive(DatagramSocket s, DatagramSocketMessageReceivedEventArgs e)
            {

    Monday, June 4, 2012 3:05 PM

Answers

  • I *think* you are running into the reusesocket problem...  I don't know if this will ever work.  I will ask around about to be sure.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    • Marked as answer by Min ZhuMember Monday, June 18, 2012 7:48 AM
    Monday, June 4, 2012 10:51 PM
    Moderator
  • I heard from the networking PM last night that he agrees with this assessment.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Thursday, June 14, 2012 1:04 PM
    Moderator

All replies

  • I *think* you are running into the reusesocket problem...  I don't know if this will ever work.  I will ask around about to be sure.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    • Marked as answer by Min ZhuMember Monday, June 18, 2012 7:48 AM
    Monday, June 4, 2012 10:51 PM
    Moderator
  • I'm asking our networking PMs to look into this post.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Monday, June 11, 2012 9:01 PM
    Moderator
  • Matt:

    Thanks - this is looking more and more like reusesocket to me, too.

    What makes it fun is Metro doesn't give any sort of error code like WinAPI/.NET 3.5 did - it just doesn't respond. Probably helps out with security and trial/error type attacks, but sure makes our  life interesting, too.

    Wednesday, June 13, 2012 7:47 PM
  • I heard from the networking PM last night that he agrees with this assessment.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    Thursday, June 14, 2012 1:04 PM
    Moderator