MCPcopy Create free account
hub / github.com/F-Stack/f-stack / FreeConnection

Method FreeConnection

adapter/micro_thread/mt_connection.cpp:741–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741void 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
772void ConnectionMgr::CloseIdleTcpKeep(TcpKeepConn* conn)
773{

Callers 4

ResetMethod · 0.80
mt_tcp_get_keep_connFunction · 0.80
mt_tcpsendrcvFunction · 0.80
mt_tcpsendFunction · 0.80

Calls 4

FreePtrMethod · 0.80
FreeTcpKeepConnMethod · 0.80
GetConnTypeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected