teamtalk关闭流程

    xiaoxiao2022-07-06  189

        if(m_socketHandle)imcore::IMLibCoreClose(m_socketHandle);

        void IMLibCoreClose(int key)     {         LOG__(NET,  _T("close key:%d"), key);         int nHandle = key;         CImConn* pConn = TcpSocketsManager::getInstance()->get_client_conn(nHandle);         if (pConn) {             pConn->Close();         }     }

    void CImConn::Close() {     netlib_close(m_handle);     ReleaseRef();     LOG__(NET,  _T("close, socket=%d"), m_handle); }

    int netlib_close(net_handle_t handle) {     CBaseSocket* pSocket = FindBaseSocket(handle);     if (!pSocket)     {         LOG__(APP, _T("can not find base socket,handle:%d"),handle);         return NETLIB_ERROR;     }

        int ret = pSocket->Close();     pSocket->ReleaseRef();     return ret; }

     

     

    最新回复(0)