[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Connection Reset as a Proxy
From:       "Oz Levanon" <Oz.Levanon () mobixell ! com>
Date:       2009-06-30 13:34:11
Message-ID: 5907C2A0ADF95448919493B9EA95D691FBDABC () mobiexc ! mobixell ! com
[Download RAW message or body]


Hi.

I'm writing a server that acts as an HTTP Proxy, and I connect to the
web using HttpClient (version 3.1)

 

From time to time I'm experiencing "Connection Reset" from the web. I
guess this is because I try to reuse connections I have from previous
requests, and (because too much time has passed), the website close the
TCP connection, or some NAT dropped the TCP connection.

 

My question is how should I solve the problem in HTTP Client?

1.       Should I set the sockets to work in keepAlive, maintaining the
TCP connection? If so, how can I do that (I only found setSoTimeout
methods, not setKeepAlive, and I can't access the socket itself, since
the getSocket() method in HttpConnection are protected)?

2.       Should I avoid using the same connection to a website as a
proxy for different clients? If so, how can I do that (I'm using
MultiThreadedHttpConnectionManager and it has no knowledge of the
clients contacting me)?

3.       Should I add a retry handler for such cases (and will it slow
things down)?

4.       Can I set some "session timeout" so that a socket will not
outlive a preset duration (that way I can set a number low enough for
any NATs on the way)?

5.       Anything else?

 

Thanks in advance,

Oz

 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic