FileDocCategorySizeDatePackage
ExecutorHttpd.javaAPI DocExample2049Sat Apr 23 22:35:26 BST 2005None

ExecutorHttpd

public class ExecutorHttpd extends Object

Fields Summary
ExecutorService
executor
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

    new ExecutorHttpd().start( Integer.parseInt(argv[0]) );
  
public voidshutdown()

    executor.shutdown();
    executor.awaitTermination( 30, TimeUnit.SECONDS );
    executor.shutdownNow();
  
public voidstart(int port)


         
  
    final ServerSocket ss = new ServerSocket( port );
    while ( !executor.isShutdown() )
      executor.submit( new TinyHttpdConnection( ss.accept() ) );