Setting Multithread doesn't create any thread. It just tells the component 
it works within a secondary thread and change the way it handle message 
retrieval. Never set MultiThread property to true when you don't really use 
the component within a thread.
--
[EMAIL PROTECTED]
http://www.overbyte.be

----- Original Message ----- 
From: "KL Chin" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Friday, July 22, 2005 8:37 AM
Subject: Re: [twsocket] HttpCli with PostASync


> Hi Francios,
>
> Thx for your suggestion.
>
> I think my problem was due to I set the Multithread to TRUE,
> hence cause high CPU usage under the thread process,
> (for the transaction about 20sec), due to this reason I touught
> by using PostAsync it can solve my problem, however another
> problem raised.
>
> Anyway with MultiThread set to FALSE look like it do solve me problem.
>
> Regards
> KL Chin
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Francois PIETTE
> Sent: Thursday, July 21, 2005 9:57 PM
> To: ICS support mailing
> Subject: Re: [twsocket] HttpCli with PostASync
>
>
>> I had create GUI app, and a thread to handle THttpCli, below partial of
>> code.
>
> You don't need a thread. Or if you do, tell me why you think you need a
> thread.
>
>> What could be the probelm?
>> Do I need call PeekMessage?
>
> Your thread need to have a message pump so that events are triggered.
> Without message pump: no event and nothing happend in an event driven
> component. You can use the message pump built into TWSocket or create your
> own (GetMessage/TranslateMessage/DispatchMessage).
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
>
>
> ----- Original Message -----
> From: "KL Chin" <[EMAIL PROTECTED]>
> To: "ICS support mailing" <twsocket@elists.org>
> Sent: Thursday, July 21, 2005 2:10 PM
> Subject: [twsocket] HttpCli with PostASync
>
>
>> Hi,
>>
>> I had create GUI app, and a thread to handle THttpCli, below partial of
>> code.
>> My problem was, after call PostAync( );  Not connection .. nothing 
>> happend
>> at all.
>> If I call Post( ); everything working.
>>
>> What could be the probelm?
>> Do I need call PeekMessage?
>>
>> Regards
>> KL Chin
>>
>> void __fastcall TWebThrd::Execute( void )
>> {
>>  DWORD  fdwwait,dwwait;
>>  String serr;
>>
>>    FwebHttp = new THttpCli( NULL );
>>    if ( FwebHttp )
>>      {
>>        FwebHttp->MultiThreaded = true;
>>        FwebHttp->SendStream    = new TMemoryStream( );
>>        FwebHttp->RcvdStream    = new TMemoryStream( );
>>        FwebHttp->OnDocBegin    = webOnDocBgn;
>>        FwebHttp->OnDocEnd      = webOnDocEnd;
>>        FwebHttp->OnDocData     = webOnDocBuf;
>>      }
>>    FOnUsed         = 1;
>>    fdwwait         = INFINITE;
>>    while ( !Terminated && !FOnQuit && !__AppOnQuit )
>>      {
>>        dwwait = WaitForMultipleObjects(
>> web_EVMAXI,FEvents,false,fdwwait );
>>        switch ( dwwait )
>>          {
>>            case (WAIT_OBJECT_0 + web_EVPOST) :
>>                  FwebHttp->URL              = FwebURLs;  //  + FwebPrms;
>>                  FwebHttp->Proxy            = FwebProxy;
>>                  FwebHttp->FollowRelocation = FFollow;
>>                  FwebHttp->PostASync( );   // Get page from internet
>> break;
>>         ...
>>        }
>>     }
>> }
>>
>> --
>> 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
>>
>
> --
> 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
>
> -- 
> 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
> 

-- 
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