On Fri, Apr 6, 2018 at 6:11 AM, Alexander D. via Boost-users
The only solution I can think of would be to cancel the read operation, but there's no portable way in asio to do this.
sock.next_layer().cancel();
?
Per ASIO Reference:
"Calls to cancel() will always fail with boost::asio::error::operation_not_supported when run on Windows XP, Windows Server 2003, and earlier versions of Windows, unless BOOST_ASIO_ENABLE_CANCELIO is defined. However, the CancelIo function has two issues that should be considered before enabling its use: ..."
which renders cancel() non-portable.
I consider the issues with cancel present in Windows XP and Windows Server 2003 to be sufficiently problematic that it is not worth taking them into account when designing robust network applications (I do develop mostly on Windows). Unless you have a specific business need to support those defective operating systems, I would just ignore them.