| 431 | } |
| 432 | |
| 433 | bool TcpKeepConn::IdleDetach() |
| 434 | { |
| 435 | if (_osfd < 0) { |
| 436 | MTLOG_ERROR("obj %p detach failed, fd %d error", this, _osfd); |
| 437 | return false; |
| 438 | } |
| 439 | |
| 440 | if (!(_keep_flag & TCP_KEEP_IN_KQUEUE)) { |
| 441 | MTLOG_DEBUG("obj %p repeat detach, error", this); |
| 442 | return true; |
| 443 | } |
| 444 | |
| 445 | _keep_ntfy.DisableOutput(); |
| 446 | _keep_ntfy.EnableInput(); |
| 447 | |
| 448 | CTimerMng* timer = MtFrame::Instance()->GetTimerMng(); |
| 449 | if (NULL != timer) |
| 450 | { |
| 451 | timer->stop_timer(this); |
| 452 | } |
| 453 | |
| 454 | if (MtFrame::Instance()->KqueueDelObj(&_keep_ntfy)) |
| 455 | { |
| 456 | _keep_flag &= ~TCP_KEEP_IN_KQUEUE; |
| 457 | return true; |
| 458 | } |
| 459 | else |
| 460 | { |
| 461 | MTLOG_ERROR("obj %p detach failed, error", this); |
| 462 | return false; |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | void TcpKeepConn::timer_notify() |
| 467 | { |
no test coverage detected