public static int getMaxTotalConnections(HttpParams httpparams) { if (httpparams == null) { throw new IllegalArgumentException("HTTP parameters must not be null."); } else { return httpparams.getIntParameter("http.conn-manager.max-total", 20); } }
public static long getTimeout(HttpParams httpparams) { if (httpparams == null) { throw new IllegalArgumentException("HTTP parameters may not be null"); } Long long1 = (Long) httpparams.getParameter("http.conn-manager.timeout"); if (long1 != null) { return long1.longValue(); } else { return (long) httpparams.getIntParameter("http.connection.timeout", 0); } }
/** * Gets the maximum number of connections allowed. * * @param params HTTP parameters * @return The maximum number of connections allowed. */ public static int getMaxTotalConnections(final HttpParams params) { Args.notNull(params, "HTTP parameters"); return params.getIntParameter(MAX_TOTAL_CONNECTIONS, DEFAULT_MAX_TOTAL_CONNECTIONS); }
/** * Obtains the value of {@link NIOReactorPNames#CONTENT_BUFFER_SIZE} parameter. If not set, * defaults to {@code 4096}. * * @param params HTTP parameters. * @return content buffer size. */ public static int getContentBufferSize(final HttpParams params) { Args.notNull(params, "HTTP parameters"); return params.getIntParameter(CONTENT_BUFFER_SIZE, 4096); }