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

Method onConnection

examples/netty/echo/server2.cc:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42 private:
43 void onConnection(const TcpConnectionPtr& conn)
44 {
45 LOG_TRACE << conn->peerAddress().toIpPort() << " -> "
46 << conn->localAddress().toIpPort() << " is "
47 << (conn->connected() ? "UP" : "DOWN");
48 conn->setTcpNoDelay(true);
49 if (conn->connected())
50 {
51 connections_.increment();
52 }
53 else
54 {
55 connections_.decrement();
56 }
57 }
58
59 void onMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp)
60 {

Callers

nothing calls this directly

Calls 5

incrementMethod · 0.80
decrementMethod · 0.80
toIpPortMethod · 0.45
connectedMethod · 0.45
setTcpNoDelayMethod · 0.45

Tested by

no test coverage detected