@Override
	public void run()
	{
		System.out.println("Server started.");
		running=true;
		while(running)
		{
			try
			{
				Socket socket=server.accept();
				if(!clients.containsKey(socket))
				{
					Client client=newClient(socket);
					clients.put(socket,client);
					client.start();
				}
			}
			catch(IOException ex)
			{
				ex.printStackTrace();
				running=false;
			}
		}
		System.out.println("Server shutting down.");
	}