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

Method onMessage

examples/simple/echo/echo.cc:34–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void EchoServer::onMessage(const muduo::net::TcpConnectionPtr& conn,
35 muduo::net::Buffer* buf,
36 muduo::Timestamp time)
37{
38 muduo::string msg(buf->retrieveAllAsString());
39 LOG_INFO << conn->name() << " echo " << msg.size() << " bytes, "
40 << "data received at " << time.toString();
41 conn->send(msg);
42}
43

Callers

nothing calls this directly

Calls 4

retrieveAllAsStringMethod · 0.80
sizeMethod · 0.45
toStringMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected