| 37 | TcpClient client_; |
| 38 | |
| 39 | void onConnection(const TcpConnectionPtr& conn) |
| 40 | { |
| 41 | LOG_INFO << conn->localAddress().toIpPort() << " -> " |
| 42 | << conn->peerAddress().toIpPort() << " is " |
| 43 | << (conn->connected() ? "UP" : "DOWN"); |
| 44 | |
| 45 | if (!conn->connected()) |
| 46 | { |
| 47 | loop_->quit(); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | void onMessage(const TcpConnectionPtr& conn, Buffer* buf, Timestamp receiveTime) |
| 52 | { |