public void run() {
    	log.info("Started server at " + serverSocket.getInetAddress().getHostName() + ":"+ serverSocket.getLocalPort() );
    	running = true;
    	try {
    	
    		while(running) {
	    		threadPool.execute(new ConnectionHandler(serverSocket.accept()));
	    	}
    		
	    	
    	} catch (IOException ex) {
    		if(running) {
    			log.log(Level.SEVERE, "caught io execpton: "+ex.getMessage(), ex);
    		} else {
    			log.fine(ex.getMessage());
    		}
    	} 
    	
    	threadPool.shutdown();
    	log.fine("Shutting down thread pool...");
    	
    	while(!threadPool.isTerminated()) {
    		try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {}
    	}
    	log.fine("Thread pool shut down");
    	
    	
    	synchronized (this) {
			notifyAll();
		}
    	System.out.println("Stopped server at " + serverSocket.getInetAddress().getHostName() + ":"+ serverSocket.getLocalPort() );
    	
    }