Package org.xlightweb.server

Examples of org.xlightweb.server.HttpServer.addConnectionHandler()


   
    System.setProperty("org.xlightweb.showDetailedError", "true");
   
    Handler hdl = new Handler()
    HttpServer server = new HttpServer("localhost", 0, hdl);
    server.addConnectionHandler(hdl);
    server.setMaxConcurrentConnections(20000);
    server.start();


    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
View Full Code Here


  public void testHttp_1_0_Request() throws Exception {
   
   
    Handler hdl = new Handler()
    HttpServer server = new HttpServer("localhost", 0, hdl);
    server.addConnectionHandler(hdl);
    server.setMaxConcurrentConnections(20000);
    server.start();


    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
View Full Code Here

  @Test
  public void testServerConnectionTimeout() throws Exception {
   
    DisconnectHandler srvHdl = new DisconnectHandler();
    HttpServer server = new HttpServer(null);
    server.addConnectionHandler(srvHdl);
    server.setConnectionTimeoutMillis(1 * 1000);
    server.start();


    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
View Full Code Here

  @Test
  public void testServerConnectionTimeout() throws Exception {
   
    DisconnectHandler srvHdl = new DisconnectHandler();
    HttpServer server = new HttpServer(null);
    server.addConnectionHandler(srvHdl);
    server.setConnectionTimeoutMillis(1 * 1000);
    server.start();


    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
View Full Code Here

    System.out.println("testServersideDataReceiveTimeout");
   
    ItWorksRequestHandler itWorksHandler = new ItWorksRequestHandler();
    HttpServer server = new HttpServer(itWorksHandler);
    server.setBodyDataReceiveTimeoutMillis(500);
    server.addConnectionHandler(itWorksHandler);
    server.start();
   
    HttpProxy proxy =  new HttpProxy(0, "localhost", server.getLocalPort(), true, 60, 30);
    proxy.start();
View Full Code Here

   
    System.out.println("testClientSideResponseTimeout");
   
    SlowItWorksRequestHandler itWorksHandler = new SlowItWorksRequestHandler();
    HttpServer server = new HttpServer(itWorksHandler);
    server.addConnectionHandler(itWorksHandler);
    server.setBodyDataReceiveTimeoutMillis(500);
    server.start();
   
    HttpProxy proxy =  new HttpProxy(0, "localhost", server.getLocalPort(), true, 60, 30);
    proxy.start();
View Full Code Here

  @Test
  public void testServerConnectionTimeout() throws Exception {
   
    DisconnectHandler srvHdl = new DisconnectHandler();
    HttpServer server = new HttpServer(null);
    server.addConnectionHandler(srvHdl);
    server.setConnectionTimeoutMillis(1 * 1000);
    server.start();


    HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
View Full Code Here

  @Test
  public void testIdleTimeout() throws Exception {

    ServerHandler srvHdl = new ServerHandler(true);
    HttpServer server = new HttpServer(srvHdl);
    server.addConnectionHandler(srvHdl);
   
    server.setIdleTimeoutMillis(500);
    server.start();

    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
View Full Code Here

  @Test
  public void testRequestTimeout() throws Exception {

    ServerHandler srvHdl = new ServerHandler(true);
    HttpServer server = new HttpServer(srvHdl);
    server.addConnectionHandler(srvHdl);
    server.setRequestTimeoutMillis(1000);
    server.start();
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    QAUtil.sleep(200);
View Full Code Here

  @Test
  public void testRequestTimeout2() throws Exception {

    ServerHandler srvHdl = new ServerHandler(false);
    HttpServer server = new HttpServer(srvHdl);
    server.addConnectionHandler(srvHdl);
    server.setRequestTimeoutMillis(1000);
    server.start();
   
    IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
    QAUtil.sleep(200);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.