Subject: Re: [boost] Udp Socket
From: Shane Baker (sbaker_at_[hidden])
Date: 2014-02-03 11:41:58
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.
I suspect that you are calling async_connect() or connect() on your socket
and then using async_send() or send(). I haven't been using Boost for some
time now, but in my experience on other platforms, you might get the
behavior you want by using async_send_to() and send_to() instead. The
behavior in terms of receiving the ICMP errors is different when you use
the socket this way.
On Sun, Feb 2, 2014 at 11:49 PM, â¢Â°o.O sÎ±Ð¼Î¹ O.oÂ°â¢ <sami.haq99_at_[hidden]>wrote:
> Asalam-o-Aliakum and Hi all,
> I am having a problem with boost udp socket.
> My program terminates after throwing exception "host unreachable".
> My questions:
> 1). why udp socket cares for host it should just send data out of its own
> port and its job is done? 2). And how it knows that host is not available
> if udp is connection less protocol?
> 3). And another simple question how to avoid program termination on this
> Best Regards;
> Sami Ul Haq
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk