Following code throws exception "No such device"
,
when trying to join the multicast group (set_option
call).
#include <boost/asio.hpp>
int main(){
const std::string recv_addr = "232.4.130.147";
const int recv_port = 31338;
boost::asio::io_service io_service;
boost::asio::ip::udp::endpoint recv_endpoint(
boost::asio::ip::address::from_string(recv_addr),
recv_port);
boost::asio::ip::udp::socket recv_sock(io_service, recv_endpoint);
recv_sock.set_option(
boost::asio::ip::multicast::join_group(
boost::asio::ip::address::from_string(recv_addr).to_v4()
));
}
不管网络-manager是否运行,都不会发生。 而没有提到IP地址。
The problem arises when I connect to an internal network with IP address manually set. On the other network, where IP is obtained from DHCP I observe no problem.
我有<代码>eth0,随时接通,这是唯一活跃的、非当地接口。
我曾尝试在上注明听话界面,但我只举一个例外情况<>Invalid case>代替>和Boostasioipmulticastjoin-group-does-not-work>。 Asio documentation 接口。