| 260 | } |
| 261 | |
| 262 | bool http_aclient::handle_ws_ping() |
| 263 | { |
| 264 | if (buff_ == NULL) { |
| 265 | buff_ = NEW string(1024); |
| 266 | } |
| 267 | |
| 268 | while (true) { |
| 269 | int ret = ws_in_->peek_frame_data(*buff_, 1024); |
| 270 | bool res; |
| 271 | switch (ret) { |
| 272 | case -1: |
| 273 | if (ws_in_->eof()) { |
| 274 | buff_->clear(); |
| 275 | return false; |
| 276 | } |
| 277 | return true; |
| 278 | case 0: |
| 279 | this->on_ws_frame_ping(*buff_); |
| 280 | if (buff_->empty()) { |
| 281 | return true; |
| 282 | } |
| 283 | |
| 284 | // �첽���� pong ���� |
| 285 | res = ws_out_->send_frame_pong(*conn_, |
| 286 | (void*) buff_->c_str(), buff_->size()); |
| 287 | buff_->clear(); |
| 288 | return res; |
| 289 | default: |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | bool http_aclient::handle_ws_pong() |
| 296 | { |
nothing calls this directly
no test coverage detected