Fastream Technologies schrieb:
> ----- Original Message ----- 
> From: "Arno Garrels" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <twsocket@elists.org>
> Sent: Wednesday, May 17, 2006 5:03 PM
> Subject: Re: [twsocket] thread message loop question
> 
> 
> : Fastream Technologies wrote:
> : >
> : > I suggest you to add a simple Sleep(1) to the message pump
> :
> : This would result in very poor performance, it's really not
> : recommended, even though it works ;-)
> :
> : For a simple message loop have a look at CtrlSocket.MessageLoop,
> : it is the built-in message pump that you can call. Property
> : CtrlSocket represents the underlying TWSocket instance,
> 
> This is already called internally with Get() and it should be fixed with 
> GetMessage.
> 
> Regards,
> 
> SZ
> 

That answers my original question, thank you.

Maybe I should explain further what I did. I started my download project
by modifying "httptst1.cpp" demo.

If I now replace Get() with GetASync() in this demo, I find that the CPU
load is the same! So my CPU load problem has nothing to do with ICS, but
   with my download method via HTTP, right?

What other method or component could I use for downloading a file from a
web server?

Regards,
Carsten

//---------------------------------------------------------------------------

void __fastcall THttpTestForm::HttpCli1HeaderEnd(TObject *Sender)
{
    for (int I = 0; I < HttpCli1->RcvdHeader->Count; I++)
    {
        AnsiString Line = HttpCli1->RcvdHeader->Strings[I];
        DisplayMemo->Lines->Add("hdr>" + Line);

        if (Line.Pos("Content-Disposition:") > 0)
        {
            int pos = Line.Pos("filename=");
            if (pos > 0)
            {
                FileName = Line.SubString(pos+10, 100);
                FileName = FileName.SubString(1, FileName.Pos("\"")-1);
            }                   
        }
    }           
}
//---------------------------------------------------------------------------

void __fastcall THttpTestForm::HttpCli1DocBegin(TObject *Sender)
{
    DisplayMemo->Lines->Add(HttpCli1->ContentType + " => " +
HttpCli1->DocName);
    DisplayMemo->Lines->Add("Document = " + HttpCli1->DocName);
    // HttpCli1->RcvdStream = new TFileStream(HttpCli1->DocName, fmCreate);
    HttpCli1->RcvdStream = new TFileStream(FileName, fmCreate);
}
//---------------------------------------------------------------------------


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to