c++socketsboostboost-asiomulticast

boost::asio multicast example


I've just began reading information about multicast transfers using boost::asio and I'm somewhat puzzled by the following:

Why do we need a "listening address" in the following boost::asio example? What's the point of that? Why would one choose anything different than localhost?

http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio/example/multicast/receiver.cpp


Solution

  • Specifying the listening IP address is necessary when you have more than one network interface card (each NIC is bound to a different IP address).