[Boost-bugs] [Boost C++ Libraries] #5756: read_some() with null_buffers blocks in non-blocking mode

Subject: [Boost-bugs] [Boost C++ Libraries] #5756: read_some() with null_buffers blocks in non-blocking mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-05 13:36:06


#5756: read_some() with null_buffers blocks in non-blocking mode
---------------------------------------------+------------------------------
 Reporter: Gennady Proskurin <gpr@…> | Owner: chris_kohlhoff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: asio
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
---------------------------------------------+------------------------------
 I want to poll socket for readability (the same as calling POSIX poll or
 select with zero timeout), to just know if it is readable:
 1. call sock.non_blocking(true)
 2. call read_some with null_buffers()
 3. it blocks

 If I change null_buffers() to some read buffer, all works fine,
 would_block error is returned. The correct behaviour, I think, is to
 return immediately with corresponding error (no error if socket is
 readable, would_block if it is not).

 At least tcp socket and posix::stream_descriptor are affected, not tested
 for other sockets. Also not tested write_some(), not sure if it is
 affected.

 test program attached

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5756>
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:07 UTC