Boost logo

Boost Users :

Subject: Re: [Boost-users] Asio and software interrupts
From: Andreas Wehrmann (a.wehrmann_at_[hidden])
Date: 2012-12-03 10:03:01


On 12/03/2012 03:51 PM, Joseph Sulewski wrote:
> Thanks guys I'll give this a try. Two questions.
>
> When I call socket->bind I provide it with an endpoint. When I create
> the endpoint I'm currently using the multicast address, what should I
> use for the address? If I'm binding to multiple multicast addresses it
> doesn't make sense to bind to one of them.
>
> Finally, it appears I can join multiple multicast groups but they need
> to be the same port. Is this correct?
>
> Thanks again
>

In socket->bind() you specify the address of the local network device
you want to listen on for incoming packets, not the multicast address
you want to join.

You can also specify "any" address (that is: "all" interfaces) like so:

socket->bind( boost::asio::ip::udp::endpoint(
boost::asio::ip::udp::v4(), port_number ) );

Or use v6(), if you want an IPv6 socket.

Regarding the port number: you can bind to only one port per socket.

-- 
Mit freundlichen Grüßen / Best regards
Andreas Wehrmann
CENTER COMMUNICATION SYSTEMS GMBH
Ein Unternehmen der STRABAG AG
Software Development
Ignaz-Köck-Str. 19
A-1210 Wien, Österreich
Tel.: +43 (0) 190 199 - 3616
Fax: +43 (0) 190 199 - 2110
Mobil: +43 (0) 664 884 75916
a.wehrmann_at_[hidden]
FN 796 88p, Sitz in Wien
Firmenbuchgericht Wien
<http://www.centersystems.com/> www.centersystems.com
Geschäftsführung: Ing. Gerhard Jelinek, Josef-Eduard Burger

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