23 #ifndef TCP_SERVER_20180131H
24 #define TCP_SERVER_20180131H
35 tcp_server(boost::asio::io_service& io_service,
short port);
36 void write(
const google::protobuf::Message& message,
const boost::asio::ip::tcp::endpoint& ep);
38 template <
typename ProtobufMessage>
43 std::make_pair(ProtobufMessage::descriptor()->full_name(), std::move(rx)));
48 std::map<boost::asio::ip::tcp::endpoint, std::weak_ptr<tcp_session>> sessions_;
49 boost::asio::ip::tcp::acceptor acceptor_;
50 boost::asio::ip::tcp::socket socket_;
52 std::unordered_multimap<std::string, std::unique_ptr<ReceiveBase>> rx_callbacks_;