cmdriver/src/CMDriver.cxx
//------------------------------------------------------------------------------------------------------
// This function will remove client with the given address
//------------------------------------------------------------------------------------------------------
This function will remove client with the given address
This function will remove client with the given address
void ClientDescriptor::RemoveClient(ClientDescriptor *p) {
    ClientDescriptor *prev = NULL;
    ClientDescriptor *cur  = sd_list;
    while(cur != NULL) {
        if(p==cur) {
            closesocket(cur->m_ClientSocket);
            if(prev == NULL)
                sd_list = cur->m_Next;
            else
                prev->m_Next = cur->m_Next;
            if(sd_list_last == cur)
                sd_list_last = prev;
            delete cur;
            return;
        }
        prev = cur;
        cur  = cur->m_Next;
    }
}
void ClientDescriptor :: RemoveClient ( ClientDescriptor * p ) { ClientDescriptor * prev = NULL ; ClientDescriptor * cur = sd_list ; while ( cur != NULL ) { if ( p == cur ) { closesocket ( cur -> m_ClientSocket ) ; if ( prev == NULL ) sd_list = cur -> m_Next ; else prev -> m_Next = cur -> m_Next ; if ( sd_list_last == cur ) sd_list_last = prev ; delete cur ; return ; } prev = cur ; cur = cur -> m_Next ; } }
This function will remove client with the given address
This function will remove client with the given address