id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12437,asio::async_read with a tcp socket gives erroneous results under Windows,anonymous,chris_kohlhoff,"I'm seeing asio::async_read give erroneous results with a tcp socket under Windows. From the asio source code, async_read under Windows calls WSARecv, and it directly violates the ""specification"" of that function. The line in error is in the function ""start_receive_op"" in the source file socket_ops.ipp. It reads: int result = ::WSARecv(impl.socket_, buffers, static_cast(buffer_count), &bytes_transferred, &recv_flags, op, 0); asio is using both the 3rd parameter lpNumberOfBytesRecvd which is set to ""&bytes_transferred"" and the 5th parameter lpOverlapped which is set to ""op"". This violates the documentation for WSARecv. According to Microsoft's documentation for WSARecv's 3rd parameter lpNumberOfBytesRecvd: ""Use NULL for this parameter if the lpOverlapped parameter is not NULL to avoid potentially erroneous results."" Because the 5th parameter lpOverlapped is not NULL, the 3rd parameter lpNumberOfBytesRecvd must be set to NULL and bytes_transferred must be determined by some other method (probably by examining the contents of the lpOverlapped parameter). ",Bugs,new,Boost 1.61.0,asio,Boost 1.62.0,Showstopper,,,