hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nir Dweck <n...@vasco-de.com>
Subject connections left in CLOSE_WAIT state
Date Wed, 19 Feb 2014 10:33:52 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message