On 03/17/2010 10:04 PM, Oleg Kalnichevski wrote:
Gajo Csaba wrote:
OK I've found a solution which works. I'm not sure if this is the
best, but so far it works.
I wrote a custom class which extends BufferingHttpClientHandler, and
overrode its timeout() method.
public void timeout(final NHttpClientConnection conn) {
HttpContext context = conn.getContext();
conn.setSocketTimeout(5000);
conn.requestOutput();
}
I basically took the source code from AsyncNHttpClientHandler and
removed the bits that referred to the internal ClientConnState class...
Regards, Csaba
Please note, though, that in this case you simply reset the connection
timeout and the connection effectively never times out. This begs the
question why you need to set timeout at all
Oleg
I think by default all sockets have some default timeout, no?
Csaba
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]