MCPcopy Create free account
hub / github.com/chenshuo/muduo / QueryServer

Method QueryServer

examples/protobuf/codec/server.cc:22–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20{
21 public:
22 QueryServer(EventLoop* loop,
23 const InetAddress& listenAddr)
24 : server_(loop, listenAddr, "QueryServer"),
25 dispatcher_(std::bind(&QueryServer::onUnknownMessage, this, _1, _2, _3)),
26 codec_(std::bind(&ProtobufDispatcher::onProtobufMessage, &dispatcher_, _1, _2, _3))
27 {
28 dispatcher_.registerMessageCallback<muduo::Query>(
29 std::bind(&QueryServer::onQuery, this, _1, _2, _3));
30 dispatcher_.registerMessageCallback<muduo::Answer>(
31 std::bind(&QueryServer::onAnswer, this, _1, _2, _3));
32 server_.setConnectionCallback(
33 std::bind(&QueryServer::onConnection, this, _1));
34 server_.setMessageCallback(
35 std::bind(&ProtobufCodec::onMessage, &codec_, _1, _2, _3));
36 }
37
38 void start()
39 {

Callers

nothing calls this directly

Calls 2

setConnectionCallbackMethod · 0.45
setMessageCallbackMethod · 0.45

Tested by

no test coverage detected