Examples of ConnectTimeoutException


Examples of org.apache.http.conn.ConnectTimeoutException

                    this.log.debug("Connection established " + conn);
                }
                return;
            } catch (final SocketTimeoutException ex) {
                if (last) {
                    throw new ConnectTimeoutException(ex, host, addresses);
                }
            } catch (final ConnectException ex) {
                if (last) {
                    final String msg = ex.getMessage();
                    if ("Connection timed out".equals(msg)) {
                        throw new ConnectTimeoutException(ex, host, addresses);
                    } else {
                        throw new HttpHostConnectException(ex, host, addresses);
                    }
                }
            }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

            sock.bind(localAddress);
        }
        try {
            sock.connect(remoteAddress, connectTimeout);
        } catch (final SocketTimeoutException ex) {
            throw new ConnectTimeoutException(host, remoteAddress);
        }
        // Setup SSL layering if necessary
        if (sock instanceof SSLSocket) {
            verifyHostname((SSLSocket) sock, host.getHostName());
        } else {
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        Assert.assertEquals(3, retryHandler.getRetryCount());

        when(request.isAborted()).thenReturn(Boolean.FALSE);
        when(context.getAttribute(ExecutionContext.HTTP_REQUEST)).thenReturn(request);

        Assert.assertFalse(retryHandler.retryRequest(new ConnectTimeoutException(), 1, context));
    }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        final DefaultHttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler();

        when(request.isAborted()).thenReturn(false);
        when(context.getAttribute(ExecutionContext.HTTP_REQUEST)).thenReturn(request);

        Assert.assertFalse(retryHandler.retryRequest(new ConnectTimeoutException(),3,context));
    }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

                Mockito.anyInt(),
                Mockito.<Socket>any(),
                Mockito.<HttpHost>any(),
                Mockito.<InetSocketAddress>any(),
                Mockito.<InetSocketAddress>any(),
                Mockito.<HttpContext>any())).thenThrow(new ConnectTimeoutException());

        connectionOperator.connect(conn, host, null, 1000, SocketConfig.DEFAULT, context);
    }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

                Mockito.anyInt(),
                Mockito.<Socket>any(),
                Mockito.<HttpHost>any(),
                Mockito.eq(new InetSocketAddress(ip1, 80)),
                Mockito.<InetSocketAddress>any(),
                Mockito.<HttpContext>any())).thenThrow(new ConnectTimeoutException());
        Mockito.when(plainSocketFactory.connectSocket(
                Mockito.anyInt(),
                Mockito.<Socket>any(),
                Mockito.<HttpHost>any(),
                Mockito.eq(new InetSocketAddress(ip2, 80)),
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

                sock.bind(localAddress);
            }
            try {
                sock.connect(remoteAddress, connectTimeout);
            } catch (SocketTimeoutException ex) {
                throw new ConnectTimeoutException(ex, host, remoteAddress.getAddress());
            }
            return sock;
        }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        try {
            sock.setSoTimeout(soTimeout);
            sock.connect(remoteAddress, connTimeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException(
                    "Connect to " + remoteAddress + " timed out", ex);
        }
        return sock;
    }
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        try {
            sock.setSoTimeout(soTimeout);
            sock.connect(remoteAddress, connTimeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException(
                    "Connect to " + remoteAddress + " timed out", ex);
        }

        String hostname;
        if (remoteAddress instanceof HttpInetSocketAddress) {
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        try {
            sock.setSoTimeout(soTimeout);
            sock.connect(remoteAddress, connTimeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
        }

        String hostname;
        if (remoteAddress instanceof HttpInetSocketAddress) {
            hostname = ((HttpInetSocketAddress) remoteAddress).getHttpHost().getHostName();
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.