Package org.eclipse.jetty.rhttp.client

Examples of org.eclipse.jetty.rhttp.client.RHTTPClient.connect()


            httpClient.start();
            try
            {
                String targetId = "1";
                final RHTTPClient client1 = new JettyClient(httpClient, address, server.getContext().getContextPath()+GatewayServer.DFT_CONNECT_PATH, targetId);
                client1.connect();
                try
                {
                    final RHTTPClient client2 = new JettyClient(httpClient, address, server.getContext().getContextPath()+GatewayServer.DFT_CONNECT_PATH, targetId);
                    try
                    {
View Full Code Here


                try
                {
                    final RHTTPClient client2 = new JettyClient(httpClient, address, server.getContext().getContextPath()+GatewayServer.DFT_CONNECT_PATH, targetId);
                    try
                    {
                        client2.connect();
                        fail();
                    }
                    catch (IOException x)
                    {
                    }
View Full Code Here

                        // If the other client can disconnect this one, this method is called soon after it disconnected
                        latch.countDown();
                        super.connectComplete(responseContent);
                    }
                };
                client1.connect();
                try
                {
                    final RHTTPClient client2 = new JettyClient(httpClient, address, server.getContext().getContextPath()+GatewayServer.DFT_CONNECT_PATH, targetId);
                    // Disconnect client 2, this should not disconnect client1
                    client2.disconnect();
View Full Code Here

        httpClient.setConnectorType(HttpClient.CONNECTOR_SOCKET);
        httpClient.start();

        RHTTPClient client = new JettyClient(httpClient, new Address("localhost", plainConnector.getPort()), server.getContext().getContextPath() + "/gw", "proxy");
        client.addListener(new ProxyListener(httpClient, client));
        client.connect();

        Runtime.getRuntime().addShutdownHook(new Shutdown(server, httpClient, client));
        logger.info("{} started", GatewayProxyServer.class.getSimpleName());
    }
View Full Code Here

                            exceptionRef.set(x);
                        }
                    }
                });

                client.connect();
                try
                {
                    // Make a request to the gateway and check response
                    ContentExchange exchange = new ContentExchange(true);
                    exchange.setMethod(HttpMethods.POST);
View Full Code Here

                            exception.set(x);
                        }
                    }
                });

                client.connect();
                try
                {
                    // Make a request to the gateway and check response
                    ContentExchange exchange = new ContentExchange(true);
                    exchange.setMethod(HttpMethods.POST);
View Full Code Here

            httpClient.start();
            try
            {
                RHTTPClient client = new JettyClient(httpClient, new Address("localhost", connector.getLocalPort()), server.getContext().getContextPath()+GatewayServer.DFT_CONNECT_PATH, "test1");
                long start = System.currentTimeMillis();
                client.connect();
                try
                {
                    long end = System.currentTimeMillis();
                    assertTrue(end - start < gwt / 2);
                }
View Full Code Here

                    public void connectRequired()
                    {
                        connectLatch.countDown();
                    }
                });
                client.connect();
                try
                {
                    assertTrue(connectLatch.await(gatewayTimeout + clientTimeout * 3, TimeUnit.MILLISECONDS));
                }
                finally
View Full Code Here

                        {
                            exceptionRef.set(x);
                        }
                    }
                });
                client.connect();
                try
                {
                    // Make a request to the gateway and check response
                    ContentExchange exchange = new ContentExchange(true);
                    exchange.setMethod(HttpMethods.POST);
View Full Code Here

    public void testConnectNoServer() throws Exception
    {
        RHTTPClient client = createClient(8080, "test1");
        try
        {
            client.connect();
            fail();
        }
        catch (IOException x)
        {
        }
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.