|
Boost Users : |
Subject: Re: [Boost-users] udp with virtual network cards
From: Gianni Ambrosio (gianni.ambrosio_at_[hidden])
Date: 2012-04-05 05:32:43
Il 4/4/2012 9:31 AM, Gianni Ambrosio ha scritto:
> void BoostUdpSocketMulticast::receiveFrom(const std::string&
> iMulticastAddress, const unsigned short iMulticastPort)
> {
> boost::system::error_code error;
> boost::asio::ip::address_v4 m_address =
> boost::asio::ip::address_v4::from_string(iMulticastAddress, error);
> boost::asio::ip::address_v4 l_address =
> boost::asio::ip::address_v4::from_string("192.168.0.85", error);
> endpoint=boost::asio::ip::udp::endpoint(l_address, iMulticastPort);
> socket.open(endpoint.protocol());
> socket.set_option(boost::asio::ip::udp::socket::reuse_address(true));
> socket.bind(endpoint);
> // join the multicast group on a specific interface
> boost::asio::ip::multicast::join_group option(m_address,l_address);
> socket.set_option(option);
> }
Why boost join_group does not work with a general
boost::asio::ip::address and an explicit conversion to ipv4 or ipv6? It
seems it should be transparent just like other piece of boost code.
Regards
Gianni
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net