I am trying to write some code that does a UDP broadcast, and then listens to replies from remote servers saying they exist. It's used to identify machines running a server app on the subnet so basically sends out a "who's there?" and listens for all the replies.
I have this in Java (works perfectly) where it sends a DatagramPacket broadcasting to a group address of 224.168.101.200. and then has a worker thread that keeps listening for incoming DatagramPackets coming in on the same socket.
This and this are not the answer as they say how to have the send and listen on different machines.
Just made a working example for you, you could compare what went wrong. I created a windows forms applications with 2 textboxes and a button.