
23 Mar
2018
23 Mar
'18
8:07 a.m.
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.