| 739 | } |
| 740 | |
| 741 | void ConnectionMgr::FreeConnection(IMtConnection* conn, bool force_free) |
| 742 | { |
| 743 | if (!conn) { |
| 744 | return; |
| 745 | } |
| 746 | CONN_OBJ_TYPE type = conn->GetConnType(); |
| 747 | |
| 748 | switch (type) |
| 749 | { |
| 750 | case OBJ_SHORT_CONN: |
| 751 | conn->Reset(); |
| 752 | return _udp_short_queue.FreePtr(dynamic_cast<UdpShortConn*>(conn)); |
| 753 | break; |
| 754 | |
| 755 | case OBJ_TCP_KEEP: |
| 756 | return _tcp_keep_mgr.FreeTcpKeepConn(dynamic_cast<TcpKeepConn*>(conn), force_free); |
| 757 | break; |
| 758 | |
| 759 | case OBJ_UDP_SESSION: |
| 760 | conn->Reset(); |
| 761 | return _udp_session_queue.FreePtr(dynamic_cast<UdpSessionConn*>(conn)); |
| 762 | break; |
| 763 | |
| 764 | default: |
| 765 | break; |
| 766 | } |
| 767 | |
| 768 | delete conn; |
| 769 | return; |
| 770 | } |
| 771 | |
| 772 | void ConnectionMgr::CloseIdleTcpKeep(TcpKeepConn* conn) |
| 773 | { |
no test coverage detected