问题
I have a Console Udp Server based on the System.Net.Sockets UdpClient from which I'm sending Udp Packets to the Ip of my Windows Phone 8.1.
The client on the phone uses Windows.Networking.Sockets DatagramSocket, my problem is that the event MessageReceived dosen't happen.
Source for DatagramSocket:https://msdn.microsoft.com/library/windows/apps/br241319
回答1:
Took me ages to find the solution since it's pretty dumb: The DatagramSocket only starts to receive after it has sent something. (At least for broadcast messages.)
Some code: https://gist.github.com/michaelosthege/857acac92b8ee689a6bb30d5bf23d9f6
来源:https://stackoverflow.com/questions/32254106/datagramsocket-event-messagereceived-dosent-trigger