Package org.xsocket.connection

Examples of org.xsocket.connection.Server.start()


  public void testNonPersistent() throws Exception {

    // start multiplexed http server
    IServer mutliplexedHttpServer = new Server(0, new MultiplexedProtocolAdapter(new HttpProtocolAdapter(new ServerHandler(false))));
    mutliplexedHttpServer.setIdleTimeoutMillis(60 * 60 * 1000);
    mutliplexedHttpServer.start();

    // start tcp concentrator
    IServer tcpConcentrator = new TcpConcentratorServer(0, "localhost", mutliplexedHttpServer.getLocalPort());
    tcpConcentrator.setIdleTimeoutMillis(60 * 60 * 1000);
    tcpConcentrator.start();
 
View Full Code Here


  public void testConcurrent() throws Exception {
   
    // start multiplexed http server
    IServer mutliplexedHttpServer = new Server(0, new MultiplexedProtocolAdapter(new HttpProtocolAdapter(new ServerHandler(true))));
    mutliplexedHttpServer.setIdleTimeoutMillis(60 * 60 * 1000);
    mutliplexedHttpServer.start();

    // start tcp concentrator
    final IServer tcpConcentrator = new TcpConcentratorServer(0, "localhost", mutliplexedHttpServer.getLocalPort());
    tcpConcentrator.setIdleTimeoutMillis(60 * 60 * 1000);
    tcpConcentrator.start();
 
View Full Code Here

  public void testSimple() throws Exception {

    // start multiplexed http server
    IServer mutliplexedHttpServer = new Server(0, new MultiplexedProtocolAdapter(new HttpProtocolAdapter(new ServerHandler(true))));
    mutliplexedHttpServer.setIdleTimeoutMillis(80 * 1000);
    mutliplexedHttpServer.start();

    // start tcp concentrator
    IServer tcpConcentrator = new TcpConcentratorServer(0, "localhost", mutliplexedHttpServer.getLocalPort());
    tcpConcentrator.setIdleTimeoutMillis(60 * 1000);
    tcpConcentrator.start();
 
View Full Code Here

                return true;
            }
        };
       
        Server server = new Server(dh);
        server.start();
       
       
        HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
        IHttpResponse response = con.call(new GetRequest("/"));
       
View Full Code Here

  public void testNonPersistent() throws Exception {

    // start multiplexed http server
    IServer mutliplexedHttpServer = new Server(0, new MultiplexedProtocolAdapter(new HttpProtocolAdapter(new ServerHandler(false))));
    mutliplexedHttpServer.setIdleTimeoutMillis(60 * 60 * 1000);
    mutliplexedHttpServer.start();

    // start tcp concentrator
    IServer tcpConcentrator = new TcpConcentratorServer(0, "localhost", mutliplexedHttpServer.getLocalPort());
    tcpConcentrator.setIdleTimeoutMillis(60 * 60 * 1000);
    tcpConcentrator.start();
 
View Full Code Here

              return true;
          }
      };
     
      Server server = new Server(dh);
      server.start();
     
     
      HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
      IHttpResponse response = con.call(new GetRequest("/"));
      System.out.println(response);
View Full Code Here

  public void testConcurrent() throws Exception {
   
    // start multiplexed http server
    IServer mutliplexedHttpServer = new Server(0, new MultiplexedProtocolAdapter(new HttpProtocolAdapter(new ServerHandler(true))));
    mutliplexedHttpServer.setIdleTimeoutMillis(60 * 60 * 1000);
    mutliplexedHttpServer.start();

    // start tcp concentrator
    final IServer tcpConcentrator = new TcpConcentratorServer(0, "localhost", mutliplexedHttpServer.getLocalPort());
    tcpConcentrator.setIdleTimeoutMillis(60 * 60 * 1000);
    tcpConcentrator.start();
 
View Full Code Here

                connection.close();
                return true;
            }
        };
        IServer server = new Server(dh);
        server.start();
       

        HttpClient httpClient = new HttpClient();
       
        ResponseAuditHandler auditInterceptor = new ResponseAuditHandler();
View Full Code Here

                connection.close();
                return true;
            }
        };
        IServer server = new Server(dh);
        server.start();
       

        HttpClient httpClient = new HttpClient();
       
        RequestAuditHandler auditInterceptor = new RequestAuditHandler();
View Full Code Here

                return true;
            }
        };
       
        IServer server = new Server(dh);
        server.start();
       
        HttpClient httpClient = new HttpClient();
       
        FutureResponseHandler hdl = new FutureResponseHandler();
        BodyDataSink ds = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + server.getLocalPort() + "/", "text/plain"), 20, hdl);
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.