test/sun/net/www/httptest/TestHttpServer.java

Print this page

        

*** 46,94 **** * the HTTPS equivalent in the JSSE regression test suite. * * NOTE NOTE NOTE NOTE NOTE NOTE NOTE */ ! public class HttpServer { ServerSocketChannel schan; int threads; int cperthread; HttpCallback cb; Server[] servers; /** ! * Create a <code>HttpServer<code> instance with the specified callback object * for handling requests. One thread is created to handle requests, * and up to ten TCP connections will be handled simultaneously. * @param cb the callback object which is invoked to handle each * incoming request */ ! public HttpServer (HttpCallback cb) throws IOException { this (cb, 1, 10, 0); } /** ! * Create a <code>HttpServer<code> instance with the specified number of * threads and maximum number of connections per thread. This functions * the same as the 4 arg constructor, where the port argument is set to zero. * @param cb the callback object which is invoked to handle each * incoming request * @param threads the number of threads to create to handle requests * in parallel * @param cperthread the number of simultaneous TCP connections to * handle per thread */ ! public HttpServer (HttpCallback cb, int threads, int cperthread) throws IOException { this (cb, threads, cperthread, 0); } /** ! * Create a <code>HttpServer<code> instance with the specified number * of threads and maximum number of connections per thread and running on * the specified port. The specified number of threads are created to * handle incoming requests, and each thread is allowed * to handle a number of simultaneous TCP connections. * @param cb the callback object which is invoked to handle --- 46,94 ---- * the HTTPS equivalent in the JSSE regression test suite. * * NOTE NOTE NOTE NOTE NOTE NOTE NOTE */ ! public class TestHttpServer { ServerSocketChannel schan; int threads; int cperthread; HttpCallback cb; Server[] servers; /** ! * Create a <code>TestHttpServer<code> instance with the specified callback object * for handling requests. One thread is created to handle requests, * and up to ten TCP connections will be handled simultaneously. * @param cb the callback object which is invoked to handle each * incoming request */ ! public TestHttpServer (HttpCallback cb) throws IOException { this (cb, 1, 10, 0); } /** ! * Create a <code>TestHttpServer<code> instance with the specified number of * threads and maximum number of connections per thread. This functions * the same as the 4 arg constructor, where the port argument is set to zero. * @param cb the callback object which is invoked to handle each * incoming request * @param threads the number of threads to create to handle requests * in parallel * @param cperthread the number of simultaneous TCP connections to * handle per thread */ ! public TestHttpServer (HttpCallback cb, int threads, int cperthread) throws IOException { this (cb, threads, cperthread, 0); } /** ! * Create a <code>TestHttpServer<code> instance with the specified number * of threads and maximum number of connections per thread and running on * the specified port. The specified number of threads are created to * handle incoming requests, and each thread is allowed * to handle a number of simultaneous TCP connections. * @param cb the callback object which is invoked to handle
*** 99,109 **** * to handle per thread * @param port the port number to bind the server to. <code>Zero</code> * means choose any free port. */ ! public HttpServer (HttpCallback cb, int threads, int cperthread, int port) throws IOException { schan = ServerSocketChannel.open (); InetSocketAddress addr = new InetSocketAddress (port); schan.socket().bind (addr); this.threads = threads; --- 99,109 ---- * to handle per thread * @param port the port number to bind the server to. <code>Zero</code> * means choose any free port. */ ! public TestHttpServer (HttpCallback cb, int threads, int cperthread, int port) throws IOException { schan = ServerSocketChannel.open (); InetSocketAddress addr = new InetSocketAddress (port); schan.socket().bind (addr); this.threads = threads;