Executor executor = Executors.newFixedThreadPool(3); ServerSocket ss = new ServerSocket( Integer.parseInt(argv[0]) ); while ( true ) executor.execute( new TinyHttpdConnection( ss.accept() ) );