How to retrieve further information when getting error #10061

Giganews Newsgroups
Subject: How to retrieve further information when getting error #10061
Posted by:  Kai Siegele (Kai.Siege…@mummert-iss.de)
Date: Tue, 19 Dec 2006

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