Boost logo

Boost :

Subject: [boost] [asio] Multicast join group does not honor interface specificatoin
From: Dale Wilson (wilsond_at_[hidden])
Date: 2009-07-01 16:51:24


I'm working with the Multicast receiver example at:

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

Notice that you specify the listen_address as you create the endpoint
that is bound to the socket. Later when you call socket::set_option with
the multicast_address, I would expect the listen_address to be honored.
The current implementation uses INET_ANY for the interface in the
multicast subscription. This means the multicast messages may arrive
on one interface while you are listening for them on another one. I
can't think of any case in which you would want to specify an IP for the
receive, but not for the join_group.

Workaround: There is a different constructor for the join_group object
that does produce the desired behavior, but it is not obvious that you
should need it. Also it does not accept boost::asio::ip::addresses as
arguments (which would make sense) but requires that you "convert" them
to ip4 (or ip6) addresses. Seems awkward.

Dale


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk