FileDocCategorySizeDatePackage
HttpdConcurrent.javaAPI DocExample870Sat Mar 13 20:23:04 GMT 2004None

HttpdConcurrent

public class HttpdConcurrent extends Httpd
HttpConcurrent - Httpd Subclass using java.lang.concurrent

Fields Summary
Executor
myThreadPool
Constructors Summary
public HttpdConcurrent()


	    
		super();
	
Methods Summary
public static voidmain(java.lang.String[] argv)

		System.out.println("DarwinSys JavaWeb Server 0.1 starting...");
		HttpdConcurrent w = new HttpdConcurrent();
		if (argv.length == 2 && argv[0].equals("-p")) {
			w.startServer(Integer.parseInt(argv[1]));
		} else {
			w.startServer(HTTP);
		}
		w.runServer();
	
public voidrunServer()

		while (true) {
			final Socket clientSocket = sock.accept();
			myThreadPool.execute(new Runnable() {
				public void run() {
					new Handler(HttpdConcurrent.this).process(clientSocket);
				}
			});
		}