Re: [Boost-bugs] [Boost C++ Libraries] #8967: Spurious zero bytes written and eof notifications highlight ASIO IOCP issues

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: 2014-05-07 00:07:29


#8967: Spurious zero bytes written and eof notifications highlight ASIO IOCP
issues
-------------------------+-------------------------------------------------
  Reporter: | Owner: chris_kohlhoff
  simoncperkins@… | Status: closed
      Type: Bugs | Component: asio
 Milestone: To Be | Severity: Problem
  Determined | Keywords: eof GetQueuedCompletionStatus
   Version: Boost | WSARecv WSASend overlapped
  1.54.0 |
Resolution: invalid |
-------------------------+-------------------------------------------------

Comment (by chris_kohlhoff):

 The comment:

> lpNumberOfBytesRecvd
>...
> Use NULL for this parameter if the lpOverlapped parameter is not NULL to
 avoid potentially erroneous results
>
> is BAD advice.
>
> If call WSARecv and pass NULL as lpNumberOfBytesRecvd and not-NULL
 lpOverlapped, then your application will generate a bunch of these:
>
> Access violation - code c0000005 (first chance)

 describes the problem exactly. I encountered it on Windows XP, or possibly
 2000, but I no longer have the system details. Furthermore, the MSDN
 Library shipped with Visual Studio 2008 did not include the "advice" for
 lpNumberOfBytesRecvd. What it does say is:

> If an overlapped operation completes immediately, WSARecv returns a
 value of zero and the lpNumberOfBytesRecvd parameter is updated with the
 number of bytes received ...

 This text still appears in the latest MSDN, for what it's worth.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8967#comment:11>
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:16 UTC