Reputation: 4044
I have two programs (MS VC++) which using multicast - receiver and sender. I test it between desktop PC (Windows 7) and netbook (Windows XP) via WiFi. Desktop PC have WiFi dongle which working in AP mode. If I specify INADDR_ANY in the interface address in the sender program, I get a problem: multicast doesn't reach netbook from desktop PC. If I specify real address of this WiFi interface instead INADDR_ANY - it working fine.
So, I want that my sender program can working on all interfaces. How I can to do that? I have to initialize separate socket for each interface? Or may be it have more elegant possibility?
Upvotes: 1
Views: 1707
Reputation: 1153
As previous people said, you have to select your output interface explicitly. If you want to multicast onto different interfaces concurrently, you'll need multiple sockets. In boost::asio, the corresponding call is:
boost::asio::ip::udp::socket* _write;
...
_write->set_option( ip::multicast::outbound_interface( ifAddr.to_v4()));
Upvotes: 2