Re: How to retrieve further information when getting error #10061

Giganews Newsgroups
Subject: Re: How to retrieve further information when getting error #10061
Posted by:  Pierre Roux (pier…@openwater.co.za)
Date: Tue, 19 Dec 2006

You'll have the HTTP response result available.  Indy 10 has this under
IdHTTP1.Response.ResponseCode for the integer value, not sure where to find
it in Indy 9.

"Kai Siegele" <Kai.Siege…@mummert-iss.de> wrote in message
news:6DE3C576D013E340Kai.Siege…@mummert-iss.de...
> Hallo,
>
> I am using the BDS 2005 and the Indy components in version 9.0.50. I have
> written a small program in C++ with which I am able to download a file
> from the internet using the following code:
>
> //---------------------------------------------------------------------------
> bool TForm1::DownloadFile(const AnsiString& strUrl, const AnsiString&
> strFile)
> //---------------------------------------------------------------------------
> {
> bool bResult = false;
>
> if ( strUrl.Length() )
> {
> InitIndyConnection();
>
> bResult = true;
> try
> {
> TFileStream* pStream = new TFileStream(strFile, fmCreate);
>
> try
> {
> IdHTTP1->Get(strUrl, pStream);
> }
> __finally
> {
> delete pStream;
> }
> }
> catch(const Exception& e)
> {
> AnsiString strMessage;
> strMessage = "Fehler beim Downloaden von ";
> strMessage += strUrl;
> strMessage += "\
";
> strMessage += e.Message;
> ShowMessage(strMessage);
> bResult = false;
> }
> }
> return bResult;
> }
>
> This has worked without any problems. But today I am getting the exception
> with error number 10061, connection refused, and I don?t know why. The
> download via the Internet Explorer still works. Has anybody an idea how to
> retrieve further information what could have gone wrong?
>
> Thanks in advance for any help.
>
> Best regards
> Kai Siegele

Replies

In response to

How to retrieve further information when getting error #10061 posted by Kai Siegele on Tue, 19 Dec 2006