C++ boost::bind with std::shared_ptr trowing operation canceled on timeout handler
问题 I´m trying to build an asynchronous server using boost::asio . The server is read only and needs to have a session timeout: If a session passes more than N seconds without receiving data, the session is disconnected and the client needs to start the connection again. SocketServer.hpp class SocketServer { public: SocketServer(boost::asio::io_service& service); virtual ~SocketServer(); void StartAsync(int port); void StopAsync(); private: void StartAccept(); void HandleAccept(std::shared_ptr