On Thu, 2012-11-22 at 15:41 +0000, James Shaw wrote: > On 22 November 2012 15:35, Oleg Kalnichevski <[email protected]> wrote: > > > On Thu, 2012-11-22 at 15:02 +0000, James Shaw wrote: > > > I've been looking at making my HttpClient interruptible. To do this, I'm > > > creating my own SocketFactory and registering it in a SchemeRegistry. > > But > > > I'm now having an issue where the request is being retried three times, > > > each time catching ClosedByInterruptException. > > > > > > I see that InterruptedIOException is already caught by > > > DefaultHttpRequestRetryHandler. Should ClosedByInterruptException be > > > added, too? > > > > Hmm. As far as I understand ClosedByInterruptException can be thrown > > only when using NIO channels, which HttpClient does not make use of per > > default. Anyway, obviously in your particular case you should probably > > be using a custom HttpRequestRetryHandler as well. > > > Yup, that's what I'm doing. Out of interest, does HttpClient have any > support for interruptible sockets? Does what I'm doing sound sane? :-)
This depends on your definition of what constitutes an interruptible socket. HttpClient makes sure that a request can aborted at any point of its execution using HttpUriRequest#abort method. This, however, achieved by shutting down the underlying connection by closing its network socket. So, what is exactly you are trying to accomplish through interruptible sockets? Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
