curl-library
Re: canceling a load in progress
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 22 Oct 2001 13:27:11 +0200 (MET DST)
Date: Mon, 22 Oct 2001 13:27:11 +0200 (MET DST)
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