List of usage examples for java.net SocketTimeoutException printStackTrace
public void printStackTrace(PrintStream s)
From source file:org.talend.core.nexus.HttpClientTransport.java
public void doRequest(IProgressMonitor monitor, final URI requestURI) throws Exception { int retries = 5; long waitMillis = 20000; int timeout = NexusServerUtils.getTimeout(); boolean fTimeout = false; for (int t = 1; t <= retries; t++) { try {//from w ww. j a va 2 s.c o m fTimeout = false; doRequestOne(monitor, requestURI); } catch (java.net.SocketTimeoutException e) { // Read timed out fTimeout = true; if (t == retries) { throw new Exception(e); } } catch (Exception e) { // DEBUG // System.err.printf("[%d] Exception occured for %s\n", t, requestURI); e.printStackTrace(System.err); // DEBUG // throw e; } if (!fTimeout) { break; } // DEBUG // System.err.printf("[%d] Read timeout (in %d millisecs) occured for %s\n", t, timeout, requestURI); // DEBUG // Thread.sleep(waitMillis * t); } }