Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8967: Spurious zero bytes written and eof notifications highlight ASIO IOCP issues
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-10 21:28:28
#8967: Spurious zero bytes written and eof notifications highlight ASIO IOCP
issues
-------------------------+-------------------------------------------------
Reporter: | Owner: chris_kohlhoff
simoncperkins@⦠| Status: new
Type: Bugs | Component: asio
Milestone: To Be | Severity: Problem
Determined | Keywords: eof GetQueuedCompletionStatus
Version: Boost | WSARecv WSASend overlapped
1.54.0 |
Resolution: |
-------------------------+-------------------------------------------------
Comment (by Shane Powell <killerbee@â¦>):
Looking at the asio code up util 1.53.0, the on_pending is used to delay
the result of a early completion routine result until after the OS call
(WSARecv/WSASend/...) has been completed.
It works because the on_pending only calls PostQueuedCompletionStatus if
op ready_ was already 1. i.e. the completion routine has already fired.
It doesn't post a PostQueuedCompletionStatus if the completion routine
hasn't fired, it just sets the ready_ to 1 which allows the the callers
completion handler to be fired in the completion routine. So I don't
think there is a problem with the on_pending code.
So the change to 1.54.0 from 'overlapped_contains_result' to using '0' is
what is causing all the problems.
I can also see you may be correct is that it's not actually required in
the case of WSARecv/WSASend/WSA* winsock functions to use the op
ready_/overlapped_contains_result. It's used in other places so you may
not be able to get rid of the overlapped_contains_result and storing the
results in the overlapped structure tho.
Also you would have to check all the other places that use the on_pending
to see if it's completely ok to remove the ready flag ok as well. I see
it's used with ReadFile/WriteFile/AcceptEx
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8967#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC