Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- header:
- class Session;
- using SessionUniquePtr = std::unique_ptr<Session>;
- using SessionSharedPtr = std::shared_ptr<Session>;
- class Session : public std::enable_shared_from_this<Session>
- {
- public:
- friend void sessionHandleRead(SessionSharedPtr ptr, const boost::system::error_code& error, bool header);
- void readNext();
- friend void sessionHandleWrite(SessionSharedPtr ptr, const boost::system::error_code& error);
- void writeNext();
- };
- source:
- void Session::writeNext()
- {
- if (mSendingPacket || mSendingQueue.empty()) return;
- mSendingPacket = mSendingQueue.pop();
- if (!mSendingPacket) return;
- asio::async_write(mSocket, asio::buffer(mSendingPacket->data(), mSendingPacket->size()),
- boost::bind(sessionHandleWrite, shared_from_this(), asio::placeholders::error));
- ^^^
- // another things,
- }
- void sessionHandleWrite(SessionSharedPtr ptr, const boost::system::error_code& error)
- {
- // do things
- }
- E:\Info\repos\RedstoneInside\src\session.cxx: In member function 'void redi::Session::writeNext()':
- E:\Info\repos\RedstoneInside\src\session.cxx:32:33: error: 'sessionHandleWrite' was not declared in this scope
- boost::bind(sessionHandleWrite, shared_from_this(), asio::placeholders::error));
Advertisement
Add Comment
Please, Sign In to add comment