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

Method QueryClient

examples/protobuf/codec/client.cc:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22{
23 public:
24 QueryClient(EventLoop* loop,
25 const InetAddress& serverAddr)
26 : loop_(loop),
27 client_(loop, serverAddr, "QueryClient"),
28 dispatcher_(std::bind(&QueryClient::onUnknownMessage, this, _1, _2, _3)),
29 codec_(std::bind(&ProtobufDispatcher::onProtobufMessage, &dispatcher_, _1, _2, _3))
30 {
31 dispatcher_.registerMessageCallback<muduo::Answer>(
32 std::bind(&QueryClient::onAnswer, this, _1, _2, _3));
33 dispatcher_.registerMessageCallback<muduo::Empty>(
34 std::bind(&QueryClient::onEmpty, this, _1, _2, _3));
35 client_.setConnectionCallback(
36 std::bind(&QueryClient::onConnection, this, _1));
37 client_.setMessageCallback(
38 std::bind(&ProtobufCodec::onMessage, &codec_, _1, _2, _3));
39 }
40
41 void connect()
42 {

Callers

nothing calls this directly

Calls 2

setConnectionCallbackMethod · 0.45
setMessageCallbackMethod · 0.45

Tested by

no test coverage detected