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

Method onConnection

examples/netty/echo/client.cc:37–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36 private:
37 void onConnection(const TcpConnectionPtr& conn)
38 {
39 LOG_TRACE << conn->localAddress().toIpPort() << " -> "
40 << conn->peerAddress().toIpPort() << " is "
41 << (conn->connected() ? "UP" : "DOWN");
42
43 if (conn->connected())
44 {
45 conn->setTcpNoDelay(true);
46 conn->send(message_);
47 }
48 else
49 {
50 loop_->quit();
51 }
52 }
53
54 void onMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp time)
55 {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected