Ortwin Glück <ortwin.glueck 'at' nose.ch> writes:

> What you could do, is the following then:
> 
> Wrap the client.execute call:
> 
> import org.apache.commons.httpclient.util.TimeoutController;
> 
> Runnable task = new Runnable() {
>     public void run() {
>        client.execute(method);
>     }
> }
> long timeout = ...; //millis
> try {
>    TimeoutController.execute(task, timeout);
> } catch(TimeoutController.TimeoutException e) {
>     /* task has been sent an interrupt signal by now */
> }

Ok, thanks for this precise code excerpt.

Is it considered safe to interrupt the execute task that way? Is
method.releaseConnection() the way to go for full cleanup of
underlying resources, or the interruption might leave things in a
bad state?

-- 
Guillaume Cottenceau

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to