DNS resolver can not really cancelled. other thread block when deconstruct the endpoint

41 views
Skip to first unread message

Lewis Liu

unread,
Feb 19, 2021, 6:58:29 PM2/19/21
to WebSocket++
I use websocketpp to implement websocket client on mobile , I observe one problem that when async_resolve timeout (default 5 seconds),it try to cancel the DNS process(resolver->cancel()),  at this moment , if main thread try to disconnect/close connection and deconstruct the endpoint object will got struct. because the async_resolve working in io service will be timeout in 30 seconds.

I have two confusion , please enlighten me, thanks
1. how to really cancel the async_resolve when DNS resolve timeout?
2. how to avoid blocking the main threading in this case?
Reply all
Reply to author
Forward
0 new messages