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

Method onConnection

examples/protobuf/codec/client.cc:48–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 private:
47
48 void onConnection(const TcpConnectionPtr& conn)
49 {
50 LOG_INFO << conn->localAddress().toIpPort() << " -> "
51 << conn->peerAddress().toIpPort() << " is "
52 << (conn->connected() ? "UP" : "DOWN");
53
54 if (conn->connected())
55 {
56 codec_.send(conn, *messageToSend);
57 }
58 else
59 {
60 loop_->quit();
61 }
62 }
63
64 void onUnknownMessage(const TcpConnectionPtr&,
65 const MessagePtr& message,

Callers

nothing calls this directly

Calls 4

toIpPortMethod · 0.45
connectedMethod · 0.45
sendMethod · 0.45
quitMethod · 0.45

Tested by

no test coverage detected