import java.net.*;
import java.util.concurrent.*;
import java.io.*;
import java.util.ArrayList;

public class Server {
    
    final ServerSocket s;
    final ExecutorService e;
    static final ArrayList<Server> all = new ArrayList<Server>();
    
    public Server(int port) throws IOException {
	s = new ServerSocket(port);
	e = Executors.newFixedThreadPool(16);
    }
    
    public void run() {
	while(true) {
	    try { e.execute(new RequestHandler(s.accept())); } catch (Exception e) {}
	}
    }
    
    public void closeSocket() {
	try { s.close(); } catch (Exception e) {}
    }
    
    public static void main(String[] args) throws InterruptedException, IOException {
	try {
	    Runtime.getRuntime().addShutdownHook(new Thread() {
		    @Override
		    public void run() {
			synchronized(Server.all) {
			    for(Server server : all)
				try { server.closeSocket(); } catch (Exception e) {}
			}
			for(int i = 0; i < RequestHandler.all.size(); i++)
			    try { RequestHandler.all.poll(5, TimeUnit.SECONDS).closeSocket(); } catch (Exception e) {}
		    }
		});
	    Server s = new Server(Integer.parseInt(args[0]));
	    s.run();
	} catch (Exception e) {}
    }
}

@@ -686,397 +686,8 @@
 y %7B%0A
-%09    Runtime.getRuntime().addShutdownHook(new Thread() %7B%0A%09%09    @Override%0A%09%09    public void run() %7B%0A%09%09%09synchronized(Server.all) %7B%0A%09%09%09    for(Server server : all)%0A%09%09%09%09try %7B server.closeSocket(); %7D catch (Exception e) %7B%7D%0A%09%09%09%7D%0A%09%09%09for(int i = 0; i %3C RequestHandler.all.size(); i++)%0A%09%09%09    try %7B RequestHandler.all.poll(5, TimeUnit.SECONDS).closeSocket(); %7D catch (Exception e) %7B%7D%0A%09%09    %7D%0A%09%09%7D);%0A
 %09   

Remove superfluous shutdown hook