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

Method onConnection

examples/asio/chat/server.cc:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34 private:
35 void onConnection(const TcpConnectionPtr& conn)
36 {
37 LOG_INFO << conn->peerAddress().toIpPort() << " -> "
38 << conn->localAddress().toIpPort() << " is "
39 << (conn->connected() ? "UP" : "DOWN");
40
41 if (conn->connected())
42 {
43 connections_.insert(conn);
44 }
45 else
46 {
47 connections_.erase(conn);
48 }
49 }
50
51 void onStringMessage(const TcpConnectionPtr&,
52 const string& message,

Callers

nothing calls this directly

Calls 3

insertMethod · 0.80
toIpPortMethod · 0.45
connectedMethod · 0.45

Tested by

no test coverage detected