2014-09-13 62 views

回答

4
SocketConfig socketConfig = SocketConfig.custom() 
     .setSoKeepAlive(true) 
     .setTcpNoDelay(true) 
     .build(); 
CloseableHttpClient client = HttpClients.custom() 
     .setDefaultSocketConfig(socketConfig) 
     .build();