Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: CookieManager thread safety

www.cryer.info
Managed Newsgroup Archive

Re: CookieManager thread safety

Subject:Re: CookieManager thread safety
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 8 May 2006 18:54:23

"dk_sz" <dk_sz@hotmail.com> wrote in message
news:445fe5dd$1@newsgroups.borland.com...

> I am not. I am freeing cookie manager when
> all http connections are all done and freed.
>
> But, and this is my theory based on what I experience,
> because of the thread/notification code, the TidHTTPs
> are not taken off the notification list correctly...

Then I suggest you NOT share a central CookieManager with multiple TIdHTTP
objects across multiple threads to begin with.  Let each thread have its own
local CookieManager (which TIdHTTP already has by default).  When making a
new HTTP request, update the local CookieManager from the central
CookieManager as needed.  When the request is finished, update the central
CookieManager with the values from the local CookieManager as needed.  his
way, the central CookieManager does not have any notifications attached to
it, and the TIdHTTP objects are free to releaser their local CookieManager
objects without any problem.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive