cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: canceling a load in progress

From: T. Bharath <TBharath_at_responsenetworks.com>
Date: Mon, 22 Oct 2001 08:11:49 -0400

Another way would be to have a bool variable(handle specific) which can be set at
any point in time using setopt and all the loops should check for this in the
code.
At any point in time the user can call this in a diffrent thread stopping the
downladprocess.
This would work on all platform

Regards
Bharath

Daniel Stenberg wrote:

> On Mon, 22 Oct 2001, tbharath wrote:
>
> > one way would be to close the socket in use from another thread But if
> > not properly implemented can lead to crashes too since closing the socket
> > when a select call is in progress can lead to this
>
> Another way that would work only on *nix systems, would be to open a pipe
> solely for this purpose. The select() would then wait for input on the pipe
> as well as on the socket(s). The cancel() call would only write a single byte
> to the pipe to make the transfer abort at once.
>
> I'd need some win32 experise to come up with a similar system for windows
> (and other operating systems that lack pipe() too).
>
> --
> Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-10-22