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

Method onQuery

examples/protobuf/codec/server.cc:59–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 void onQuery(const muduo::net::TcpConnectionPtr& conn,
60 const QueryPtr& message,
61 muduo::Timestamp)
62 {
63 LOG_INFO << "onQuery:\n" << message->GetTypeName() << message->DebugString();
64 Answer answer;
65 answer.set_id(1);
66 answer.set_questioner("Chen Shuo");
67 answer.set_answerer("blog.csdn.net/Solstice");
68 answer.add_solution("Jump!");
69 answer.add_solution("Win!");
70 codec_.send(conn, answer);
71
72 conn->shutdown();
73 }
74
75 void onAnswer(const muduo::net::TcpConnectionPtr& conn,
76 const AnswerPtr& message,

Callers

nothing calls this directly

Calls 3

set_idMethod · 0.80
shutdownMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected