Boost logo

Boost :

Subject: Re: [boost] Udp Socket
From: Shane Baker (sbaker_at_[hidden])
Date: 2014-02-03 13:30:24


It's hard to be helpful without more information. Assuming that you are
getting a boost::system::system_error thrown in direct response to the
send_to() call, I would:

1. Examine your route table to see if there is a problem there.
2. Try using traceroute to your desired address.
3. Try using Wireshark to get more insight.

On Mon, Feb 3, 2014 at 12:51 PM, •°o.O sαмι O.o°• <sami.haq99_at_[hidden]>wrote:

> 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
> >
>
> _______________________________________________
> 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