hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Simulate "Connection Reset" using HttpCore
Date Sun, 15 Feb 2009 23:48:54 GMT
Chris Lowe wrote:
> Hello,
> I'd like to test some client logic that handles SocketException "Connection
> Reset" errors. Problem is, this can be an intermittent problem so testing it
> is proving difficult. Could anyone tell me if there is a way to force this
> condition using HttpService?
> 
> Cheers,
> 
> Chris.
> 

Hi Chris

You may want to try to set SO_LINGER socket option to zero as described here

http://wiki.apache.org/HttpComponents/FrequentlyAskedConnectionManagementQuestions

Google for more details on SO_LINGER and its use (abuse).

Please also note you will most likely to subclass the default 
implementation of HttpConnection and override the behavior of #shutdown 
method or provide a custom method to abort connections.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message