Boost logo

Boost :

Subject: Re: [boost] Udp Socket
From: •°o.O sαмι O.o°• (sami.haq99_at_[hidden])
Date: 2014-02-03 12:51:45


Thanks to both Baker and Trey,
 I am not using any asyn.connect or connect method in my program just
using "send_to" method
" socket.send_to(boost::asio::buffer(send_buf), receiver_endpoint);"
My requirement is to send data to multiple specified addresses and one of
them might be not available at that time so program should keep sending
data to other available addresses but it terminates after throwing
exception "host unreachable". Broadcast cannot be used.

On Mon, Feb 3, 2014 at 10:12 PM, Joseph Van Riper <
fleeb.fantastique_at_[hidden]> wrote:

> On Mon, Feb 3, 2014 at 11:41 AM, Shane Baker <sbaker_at_[hidden]> wrote:
>
> > I cannot comment on your program termination error.
> >
> > Regarding UDP being a connectionless protocol, errors may still be
> returned
> > if the destination host is not reachable. These errors are returned via
> > ICMP. You can see this with Wireshark or a similar tool.
> >
> >
> As Baker points out, UDP still runs over IP, which is a routing protocol.
> If you send packets over UDP, it usually needs to reach a specific
> destination.
>
> If you have no destination in mind, you may broadcast your packets instead,
> for any receiving interface to receive. To do this, you'd need to set the
> 'broadcast' option. If you do that, you probably also want to set the
> do_not_route option as well, to limit how far such messages would broadcast
> (although, practically speaking, most routers will likely prevent your
> broadcast packets anyway).
>
> - Trey
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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