serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// This function will remove all clients which depend upon state
//------------------------------------------------------------------------------
This function will remove all clients which depend upon state
This function will remove all clients which depend upon state
void ClientDescriptor::RemoveStateClients() {
    ClientDescriptor *prev = NULL;
    ClientDescriptor *cur  = sd_list;
    while(cur != NULL) {
                if(cur->m_Type!=1) { 
                if (cur->m_Type != -1) {
                        LogConnectionEvent( cur, 0 );
                        }
                closesocket(cur->m_ClientSocket);
                closesocket(cur->m_ServerSocket);
                if (m_NumberClients > 0) m_NumberClients--;
                if(prev == NULL) sd_list = cur->m_Next;
            else prev->m_Next = cur->m_Next;
                if(sd_list_last == cur) sd_list_last = prev;
                } else {
                prev = cur;
                }
        cur  = cur->m_Next;
    }
}
void ClientDescriptor :: RemoveStateClients ( ) { ClientDescriptor * prev = NULL ; ClientDescriptor * cur = sd_list ; while ( cur != NULL ) { if ( cur -> m_Type != 1 ) { if ( cur -> m_Type != -1 ) { LogConnectionEvent ( cur , 0 ) ; } closesocket ( cur -> m_ClientSocket ) ; closesocket ( cur -> m_ServerSocket ) ; if ( m_NumberClients > 0 ) m_NumberClients -- ; if ( prev == NULL ) sd_list = cur -> m_Next ; else prev -> m_Next = cur -> m_Next ; if ( sd_list_last == cur ) sd_list_last = prev ; } else { prev = cur ; } cur = cur -> m_Next ; } }
This function will remove all clients which depend upon state
This function will remove all clients which depend upon state
// If this client depends on the state