Hi, I am using httpclient version 4.2.3. I did a split proxy, which receives an HTTP requests, opens its body in order to log its content and then sends the content in two requests, one for the local host server and the other to a different server running a newer version of our software. this is the code I used to create the http client: PoolingClientConnectionManager mngr = new PoolingClientConnectionManager(); mngr.setMaxTotal(400); mngr.setDefaultMaxPerRoute(200); m_http = new DefaultHttpClient(mngr); m_http.getParams().setParameter(CoreProtocolPNames.USER_AGENT, "phytech proxy"); m_http.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000); m_http.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 5000);
When I need to send a request to the remote host, I take a thread from a thread pool which will perform the operation asynchronously. The proxy and the old server are running windows and the new server is on a Linux machine. The problem is I get tones of connections with the remote server which are stuck in CLOSE_WAIT state and never get released (none with the local host - I think it is related to the fact the local machine is windows). When I look at the sniffer I don't see any FIN message coming out of my client, although I set SO_TIMEOUT to 5 seconds and there were more than 5 seconds of inactivity. Any idea what am I doing wrong and how to solve it? Thanks, Nir