Boost logo

Boost Users :

Subject: Re: [Boost-users] asio: async_write handler not called in Linux but called in Windows
From: Lloyd (lloydkl.tech_at_[hidden])
Date: 2015-07-17 04:15:05

Further debugging the issue, I found that if I pass a small buffer (like
10KB) to write, the async_write handler (HandleWrite) is called. I was passing
128 MB of data to be written in a single async_write call. Does this has
something to do with not calling the write handler? In Wondows also I am
passing 128 MB buffer, but it works!

On Thu, Jul 16, 2015 at 3:03 PM, Lloyd <lloydkl.tech_at_[hidden]> wrote:

> Hi,
> I have an application that need to work on both Windows and Linux. We are
> using asio for network communication (boost 1.57). In this, once the
> connection is established with the server, the connection handler in client
> executes the following async calls...
> boost::asio::async_read_until(Socket, stream, string("\r\n"),
> boost::bind(&MyConnection::HandleRead, shared_from_this(),
> boost::asio::placeholders::error));
> ...
> ...
> ...
> boost::asio::async_write(Socket,boost::asio::buffer(buff,len),
> boost::bind(&MyConnection::HandleWrite,shared_from_this(),
> boost::asio::placeholders::error,boost::asio::placeholders::bytes_transferred));
> On Windows, the "HandleWrite" function is called as soon as the data is
> written. But on Linux this function never gets called!. In Linux and
> Windows HandleRead is getting called as expected.
> In bot the the case, the server receives the data properly. Is there any
> reason for this?
> Thanks,
> Lloyd

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at