#ifndef NET_RPC_SESSION_H #define NET_RPC_SESSION_H #include #include #include #include #include namespace Egametang { class RpcServer; class RpcSession: private boost::noncopyable, public boost::enable_shared_from_this { private: boost::asio::ip::tcp::socket socket_; RpcServer& rpc_server_; void RecvMessegeSize(); void RecvMessage(IntPtr size, const boost::system::error_code& err); void RecvMessageHandler(StringPtr ss, const boost::system::error_code& err); void SendMessageSize(RpcResponsePtr response); void SendMessage(const RpcResponsePtr response, const boost::system::error_code& err); void SendMessageHandler(int32 id, RpcHandlerPtr handler, const boost::system::error_code& err); public: RpcSession(RpcServer& server); ~RpcSession(); boost::asio::ip::tcp::socket& Socket(); void Start(); void Stop(); }; } // namespace Egametang #endif // NET_RPC_SESSION_H