可读写事件回调
| 43 | |
| 44 | // 可读写事件回调 |
| 45 | void onMessage(const TcpConnectionPtr &conn, Buffer *buf, Timestamp time) |
| 46 | { |
| 47 | printf("onMessage!\n"); |
| 48 | std::string msg = buf->retrieveAllAsString(); |
| 49 | conn->send(msg); |
| 50 | // conn->shutdown(); // 关闭写端 底层响应EPOLLHUP => 执行closeCallback_ |
| 51 | } |
| 52 | |
| 53 | EventLoop *loop_; |
| 54 | TcpServer server_; |
nothing calls this directly
no test coverage detected