serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// This function will remove all clients.
//------------------------------------------------------------------------------
This function will remove all clients.
This function will remove all clients .
void ClientDescriptor::RemoveAllClients(void) {
    ClientDescriptor *p;
    ClientDescriptor *cur  = sd_list;
    while(cur != NULL) {
                p=cur;
                if (m_NumberClients > 0) {
                    m_NumberClients --;
                }
                if (p->m_Type != -1) {
                    LogConnectionEvent( p, 0 );
                }
                cur  = cur->m_Next;
                closesocket(p->m_ClientSocket);
                if(p->m_LastCommand!=NULL)  {
                        free(p->m_LastCommand);
                        p->m_LastCommand=NULL;
                }
                if(p->m_UserName!=NULL) {
                    free(p->m_UserName);
                        p->m_UserName=NULL;
                }
                delete p;
    }
    sd_list=sd_list_last=NULL;
    m_NumberClients = 0;
}
void ClientDescriptor :: RemoveAllClients ( void ) { ClientDescriptor * p ; ClientDescriptor * cur = sd_list ; while ( cur != NULL ) { p = cur ; if ( m_NumberClients > 0 ) { m_NumberClients -- ; } if ( p -> m_Type != -1 ) { LogConnectionEvent ( p , 0 ) ; } cur = cur -> m_Next ; closesocket ( p -> m_ClientSocket ) ; if ( p -> m_LastCommand != NULL ) { free ( p -> m_LastCommand ) ; p -> m_LastCommand = NULL ; } if ( p -> m_UserName != NULL ) { free ( p -> m_UserName ) ; p -> m_UserName = NULL ; } delete p ; } sd_list = sd_list_last = NULL ; m_NumberClients = 0 ; }
This function will remove all clients.
This function will remove all clients .