RpcServer.h 466 B

12345678910111213141516171819202122232425
  1. #ifndef NET_RPC_SERVER_H
  2. #define NET_RPC_SERVER_H
  3. namespace Hainan {
  4. class RpcServer
  5. {
  6. private:
  7. typedef boost::unordered_set<RpcSessionPtr> RpcSessionSet;
  8. google::protobuf::Service& service;
  9. boost::asio::io_service io_service;
  10. boost::asio::ip::tcp::acceptor acceptor;
  11. RpcSessionSet sessions;
  12. public:
  13. RpcServer(google::protobuf::Service& pservice, int port);
  14. ~RpcServer();
  15. void Start();
  16. void Stop();
  17. };
  18. } // namespace Hainan
  19. #endif // NET_RPC_SERVER_H