Re: Cancelling HTTP GET?

Giganews Newsgroups
Subject: Re: Cancelling HTTP GET?
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Mon, 23 Oct 2006

"Dave S" <nospamforme@nospam.com> wrote in message
news:5A3040D4C10CE340nospamforme@nospam.com...

> Using IdHTTP from Indy 10 with D7, is there a way to cancel
> a download after it has begun from calling .Get() ?

The only way is to throw an exception inside the OnWork event, or disconnect
the socket from another thread.

> I want to offer the user a Cancel button on a download progress
> dialog.

Then you should be doing the download in a worker thread, posting status
notifications to the dialog when needed, and then have the dialog disconnect
the socket when needed.

Gambit

Replies

In response to

Cancelling HTTP GET? posted by Dave S on Mon, 23 Oct 2006