Multicast UDP server fails to receive unicast UDP packages
Using the multicast example server, I can get it to receive messages sent to the multicast group. But if I send direct UDP messages to ip_address:30001, the server doesn't receive anything. I'm pretty sure this is supposed to work? Using version 1.22.1.
It depends on the bind of the server socket.
The bind is on 0.0.0.0:30001 here https://github.com/chriskohlhoff/asio/blob/master/asio/src/examples/cpp11/multicast/receiver.cpp#L27
If I send UDP to multicast_ip:30001, it is received. But if I send to 192.168.16.173:30001 (example ip), nothing is received.
This should work, I'd launch up wireshark or something to make sure the packets properly arrive to the machine.
Ok, this is weird. Just retried it (running sender/receiver on same machine) and it works just as expected... ./sender 239.255.0.1 ./sender 127.0.0.1 ./sender 192.168.1.219 all works. Mind you, I just tested in Linux (Ubuntu 18.04), but I've mostly experienced problems on Windows. I'll have to check this.
Ok. This is odd. With port number 1900 (instead of 30001) I get the problem, but not with f.i. 1901. 1900 is the port number used for UPnP multicast search. Why would that port number be special?
Can it be that another application has opened port 1900 in non-reuse mode?