Open MatthiasVonLaer opened 1 year ago
Oh thank you very much for you cancellation implemention. I changed the code and tested with asio-1.28.0, everything is ok on my ubuntu22.04 even when I changed the buffer to 4MB. But windows is not matching. My code is here https://github.com/uniqss/net_study/blob/main/src/cancellation.cpp , and I made some change to depend on asio only, not depending on boost.
Hello,
I'm seeing a problem with the partial cancellation of the async_wirte method.
If I call async_write and cancel it with a partial cancellation, I expect the return value bytesTransfered to refer to the bytes that have been actually transfered into the TCP stream. If not all the data has been written, I expect that I can continue later on to write the remaining data to the stream, resulting in consistent data.
Is this a correct expectation?
On a Windows system I realized that this is not the case if I cancel an async_write operation on a TCP stream that is under back pressure:
It works if I change one of the following:
I've tested with Boost.Asio 1.26.0 and Visual Studio 2022 17.5 (_MSC_VER 1935). See the example code below.
Best regards, Matthias von Laer