List of usage examples for org.apache.http.impl.nio.reactor IOReactorConfig.Builder setSoTimeout
@Deprecated public void setSoTimeout(final int soTimeout)
From source file:com.networknt.client.Client.java
private ConnectingIOReactor ioReactor() throws ClientException { Map<String, Object> asyncMap = (Map) config.get(ASYNC); Map<String, Object> reactorMap = (Map) asyncMap.get(REACTOR); Integer ioThreadCount = (Integer) reactorMap.get(REACTOR_IO_THREAD_COUNT); IOReactorConfig.Builder builder = IOReactorConfig.custom(); builder.setIoThreadCount(/*from ww w . j a va 2 s . co m*/ ioThreadCount == null ? Runtime.getRuntime().availableProcessors() : ioThreadCount); Integer connectTimeout = (Integer) reactorMap.get(REACTOR_CONNECT_TIMEOUT); builder.setConnectTimeout(connectTimeout == null ? DEFAULT_REACTOR_CONNECT_TIMEOUT : connectTimeout); Integer soTimeout = (Integer) reactorMap.get(REACTOR_SO_TIMEOUT); builder.setSoTimeout(soTimeout == null ? DEFAULT_REACTOR_SO_TIMEOUT : soTimeout); ConnectingIOReactor reactor = null; try { reactor = new DefaultConnectingIOReactor(builder.build()); } catch (IOReactorException e) { logger.error("IOReactorException: ", e); throw new ClientException("IOReactorException: ", e); } return reactor; }