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

Method onClientMessage

examples/multiplexer/multiplexer_simple.cc:113–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111 }
112
113 void onClientMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp)
114 {
115 if (!conn->getContext().empty())
116 {
117 int id = boost::any_cast<int>(conn->getContext());
118 sendBackendBuffer(id, buf);
119 }
120 else
121 {
122 buf->retrieveAll();
123 // FIXME: error handling
124 }
125 }
126
127 void sendBackendBuffer(int id, Buffer* buf)
128 {

Callers

nothing calls this directly

Calls 2

retrieveAllMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected