Boost logo

Boost Users :

Subject: [Boost-users] boost::asio::async_read Error Operation canceled
From: jupiter (jupiter.hce_at_[hidden])
Date: 2017-08-07 01:26:32


Hi,

I have a client program written by someone who is no longer available. The
client program can send a message via async_write to server, but when the
server responded back, the client boost::asio::async_read got an error of
Operation cancelled. Searching from the Internet, it said the program was
caused mostly by using this which should be fixed by using
shared_from_this(). But in my client program it does not use this or
shared_from_this, could someone explains if it uses some default format
implies to this or shared_from_this in following example? (What (=) means,
some kind of lambda function?)

boost::asio::async_read(this->socket,
boost::asio::buffer(this->messageHeader),
[=](const boost::system::error_code &error, const uint32_t length)
{this->readMessageHeader(error, length);});

Thank you.

Kind regards.



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