import java.util.ArrayList;
public class ServerClassNetwork extends Thread
{
public ArrayList clientGroup = new ArrayList();
public ClientClassNetwork localCopy;

public static void main (String [] args)
   {
	new ServerClassNetwork();
   }

public ServerClassNetwork()
   {
	startNetwork();
	}
  
// initialize the network  
public void startNetwork()  
	{   
	for( int x=0; x<100; x++ )
	   {
	   ClientClassNetwork client = new ClientClassNetwork( x );
      client.start();
	   clientGroup.add( client );
	   }
   this.start();
   } // end main

// what the server does once it's started
public void run()
   {
	while (true)
	   {	
		try
		   {
		   this.sleep(1000);	
			}
		catch( InterruptedException ie )
		   {
			System.out.println("Thread problem");
			}
		
		for( int y=0; y<clientGroup.size(); y++ )
		   { 
			localCopy = (ClientClassNetwork)clientGroup.get( y );
			
			if ( localCopy.ClientToServer.equals( "exit") )
			   {
				System.exit(0);
				}
			} // end for
	   } // while true	   
   }  // end run()
   
} // end class
