|
Boost Users : |
Subject: [Boost-users] asio: async_write handler not called in Linux but called in Windows
From: Lloyd (lloydkl.tech_at_[hidden])
Date: 2015-07-16 05:33:10
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 hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net