| 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, |