From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2021-08-25 10:23:21
On 8/25/21 11:27 AM, Richard Hodges via Boost wrote:
> There are a couple of convoluted ways to build cancellation into the linux
> resolve() activity.
> The problem is that the sockets and timers used for this are entirely
> embedded in the OS-shipped library layer and not accessible to user code.
> It's a bit of a mess that has never been cleaned up. There isn't much that
> Asio can do about it.
> At present the "cleanest" way is to fork a child process to do the resolve
> call for you and async_wait on a pipe from that child. If you want to
> cancel it, send the child a SIGKILL which will result in the wait on the
> pipe completing with an error.
> Ghastly I know...
On Linux, there is also getaddrinfo_a:
which allows to perform name resolution asynchronously, with
cancellation. It's a GNU extension. I wonder if it can be incorporated
PS: Please, don't top-post.
> On Wed, 25 Aug 2021 at 08:30, sandeep m.v <venkata.sandeep.m_at_[hidden]>
>> Thank you for the response.
>> We build our application for multiple platforms, Windows, Linux, Android
>> and iOS.
>> If it is not possible to cancel, is there a way to close internal socket,
>> so that it wont callback resolve handler?
>> By that way, we can at least go ahead with our processing after our
>> internal timeout assuming callback never happen later.
>> Is that something possible?
>> On Wed, Aug 25, 2021 at 1:29 AM Richard Hodges via Boost <
>> boost_at_[hidden]> wrote:
>>> On Linux async_resolve is currently implemented in terms of a spawned
>>> thread which calls a synchronous function. It has a 30s timeout and canât
>>> be cancelled.
>>> On Tue, 24 Aug 2021 at 21:56, Vinnie Falco via Boost <
>>>> On Tue, Aug 24, 2021 at 12:09 PM sandeep m.v via Boost
>>>> <boost_at_[hidden]> wrote:
>>>>> Can someone please help me with this?
>>>> Are you by chance using Windows? What version?
>>>> Unsubscribe & other changes:
>>> Richard Hodges
>>> office: +44 2032 898 513
>>> home: +376 861 195
>>> mobile: +376 380 212
>>> Unsubscribe & other changes:
>> Mob# 9000707098
> 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