Examples of ConnectTimeoutException


Examples of org.apache.commons.httpclient.ConnectTimeoutException

     throws IOException, UnknownHostException, ConnectTimeoutException
    {
            try {
                TimeoutController.execute(task, timeout);
            } catch (TimeoutController.TimeoutException e) {
                throw new ConnectTimeoutException(
                    "The host did not accept the connection within timeout of "
                    + timeout + " ms");
            }
            Socket socket = task.getSocket();
            if (task.exception != null) {
View Full Code Here

Examples of org.apache.hadoop.net.ConnectTimeoutException

      Socket spy = Mockito.spy(defaultFactory.createSocket());
      // Simplify our spying job by not having to also spy on the channel
      Mockito.doReturn(null).when(spy).getChannel();
      // Throw a ConnectTimeoutException when connecting to our target "bad"
      // host.
      Mockito.doThrow(new ConnectTimeoutException("injected"))
        .when(spy).connect(
            Mockito.argThat(new MatchesPort()),
            Mockito.anyInt());
      return spy;
    }
View Full Code Here

Examples of org.apache.hadoop.net.ConnectTimeoutException

  }

  private void assertRetriesOnSocketTimeouts(Configuration conf,
      int maxTimeoutRetries) throws IOException {
    SocketFactory mockFactory = Mockito.mock(SocketFactory.class);
    doThrow(new ConnectTimeoutException("fake")).when(mockFactory).createSocket();
    Client client = new Client(IntWritable.class, conf, mockFactory);
    InetSocketAddress address = new InetSocketAddress("127.0.0.1", 9090);
    try {
      client.call(new IntWritable(RANDOM.nextInt()), address, null, null, 0,
          conf);
View Full Code Here

Examples of org.apache.hadoop.net.ConnectTimeoutException

  }

  private void assertRetriesOnSocketTimeouts(Configuration conf,
      int maxTimeoutRetries) throws IOException {
    SocketFactory mockFactory = Mockito.mock(SocketFactory.class);
    doThrow(new ConnectTimeoutException("fake")).when(mockFactory).createSocket();
    Client client = new Client(IntWritable.class, conf, mockFactory);
    InetSocketAddress address = new InetSocketAddress("127.0.0.1", 9090);
    try {
      client.call(new IntWritable(RANDOM.nextInt()), address, null, null, 0,
          conf);
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        sock.bind(localAddress);
        try {
            sock.connect(remoteAddress, HttpConnectionParams.getConnectionTimeout(params));

        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
        }
        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");
        }

        // HttpInetSocketAddress#toString() returns original hostname value of the remote address
        String hostname = remoteAddress.toString();
        int port = remoteAddress.getPort();
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        int soTimeout = HttpConnectionParams.getSoTimeout(params);

        try {
            sslsock.connect(remoteAddress, connTimeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
                    + remoteAddress.getAddress() + " timed out");
        }
        sslsock.setSoTimeout(soTimeout);
        if (this.hostnameVerifier != null) {
            try {
View Full Code Here

Examples of org.apache.http.conn.ConnectTimeoutException

        }
        int timeout = HttpConnectionParams.getConnectionTimeout(params);
        try {
            sock.connect(remoteAddress, timeout);
        } catch (SocketTimeoutException ex) {
            throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
                    + remoteAddress.getAddress() + " timed out");
        }
        return sock;
    }
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

        int timeout = HttpConnectionParams.getConnectionTimeout(params);

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

        return sock;
    }
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.