| 99 | } |
| 100 | |
| 101 | void do_echo(void) { |
| 102 | char buf[4096]; |
| 103 | |
| 104 | int times = 0; |
| 105 | while (true) { |
| 106 | int ret = conn_->read(buf, sizeof(buf), false); |
| 107 | if (ret == -1) { |
| 108 | if (acl::last_error() != EAGAIN) { |
| 109 | break; |
| 110 | } |
| 111 | |
| 112 | printf("Times of timeout: %d\r\n", ++times); |
| 113 | |
| 114 | if (times >= times_) { |
| 115 | break; |
| 116 | } |
| 117 | |
| 118 | continue; |
| 119 | } |
| 120 | |
| 121 | times = 0; |
| 122 | |
| 123 | if (conn_->write(buf, ret) == -1) { |
| 124 | break; |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | }; |
| 129 | |
| 130 | ////////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected