Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::asio blocking socket read with timeout with multiple threads
From: Richard Hodges (hodges.r_at_[hidden])
Date: 2018-03-23 08:10:54


On Fri, 23 Mar 2018 at 09:07, Thomas Quarendon via Boost-users <
boost-users_at_[hidden]> wrote:

>
> > You can use a deadline_timer and cancel the synchronous read if it
> > trips. It's a bit fugly though and is subject to races. It's much
> > nicer to use async.
>
> The point is though that I don't think this works. This is what I started
> with.
> It works on Windows OK. But on Linux, calling "cancel" or "close" on a
> socket doesn't
> cancel a synchronous read call. This is what started me down this whole
> route.

This seems unlikely. I have been using asio in production code on Linux for
4 years. Can you post a mcve so I can test?

>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net