|
Boost Users : |
Subject: Re: [Boost-users] [asio] Problem with async_read/async_read_some not reacting to incoming data
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-19 10:59:58
> Has anyone seen something similar or have any input on how best to figure out what goes wrong?
We use asio for very intensive streaming/playback, and we never
encountered such an issue.
>Â Are there invariants that says you cannot read and write at the same time?
No, you can.
> Some symptoms are the same in each test. Â When we get the last image from
> the socket the buffersize is zero afterwards, and the next async_read
> request is to transfer_at_least(1). Â The async_read never calls the handler
> for completion of this byte, so Nagle would have kicked in.
One of the main invariants in asio is that every async_read ends with
a call of its handler. So you have to check 2 points: 1) ensure that
async_read was really called, 2) ensure that the data you're waiting
for were *not* received during in the previous call of async_read.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net