Wilfred Owen wrote:
> Hi Dod
> I understand the point you are making. I intended to use the HTTPCli
> component as part of an existing application which already uses threads.
> The threads need to test response from websites as part of the other
> activities they carry out - this is why this approach seemed most natural
> to me, within the context of an existing application,
Of course it's no problem to run the THttpCli in threads as long as the
thread has a working message pump. However a thread per HTTP connection may
waste resources. Have you read these articles?
(The wiki is still under construction but both articles may point
you to the right direction)
How many concurrent connections do you expect?
Arno Garrels [TeamICS]
> although I
> appreciate if were starting from afresh there could be better approaches!
>> From: Dod <[EMAIL PROTECTED]>
>> Reply-To: ICS support mailing <email@example.com>
>> To: ICS support mailing <firstname.lastname@example.org>
>> Subject: Re: [twsocket] HTTPCli in multithreaded application
>> Date: Mon, 10 Apr 2006 11:27:59 +0200
>> Hello Wilfred,
>> Main question is "why use threads ?" ICS main advantage is to work in
>> non threaded model, just create 10, 20, 30 instances of THHPCli and
>> connect them :-)
>> WO> Hello
>> WO> I am new to ICS. I wish to use the HTTPCli component in a
>> multithreaded WO> application to test the response from websites. Any
>> thread within the WO> application may use an HTTPCli object to make such
>> a test.
>> WO> My preferred approach would be: within a thread, create an HTTPCli
>> WO> dynamically using the create method, and set the URL property. Then
>> set WO> handlers for onDocData, and onRequestDone and retrieve the page
>> using the
>> WO> Get() function. Use an exception handler to trap any problem with
>> WO> - Do you see any potential problems with this, given that it will
>> occur in a
>> WO> multithreaded environment?
>> WO> - Are there any problems with having multiple HTTPCli objects running
>> WO> multiple threads as described?
>> WO> - Also, do I need to set the multithreaded property to true?
>> WO> Thank you in advance for any assistance you can give.
>> WO> Wilf
>> 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