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

Method onConnection

examples/simple/timeclient/timeclient.cc:39–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 TcpClient client_;
38
39 void onConnection(const TcpConnectionPtr& conn)
40 {
41 LOG_INFO << conn->localAddress().toIpPort() << " -> "
42 << conn->peerAddress().toIpPort() << " is "
43 << (conn->connected() ? "UP" : "DOWN");
44
45 if (!conn->connected())
46 {
47 loop_->quit();
48 }
49 }
50
51 void onMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp receiveTime)
52 {

Callers

nothing calls this directly

Calls 3

toIpPortMethod · 0.45
connectedMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected