|
Boost : |
From: Jupiter (jupiter.hce_at_[hidden])
Date: 2020-04-08 00:35:45
Hi,
I am doing boost local unix domain for IPC, I midified the code based
on sample code from boost_asio/example/local/stream_server.cpp, I am a
little bit puzzled for errors calling different async_read, if I call
original code using shared_from_this() it works fine:
boost::asio::async_read(this->mSocket,
boost::asio::buffer(this->mData), boost::bind(&session::HandleRead,
shared_from_this(), boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred));
But if I tried to run a following lambda function which works in in my
other boost asio TCP socket, it got an error "Operation canceled",
what I could be missing here? Or do I have fundamontal problems in the
lambda function I used for other TCP socket programs?
boost::asio::async_read(this->mSocket,
boost::asio::buffer(this->mData, sizeof(this->mData)), [=](const
boost::system::error_code &status, const uint32_t size)
{this->HandleRead(status, size);});
Thank you.
Kind regards,
- jh
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk