Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: TidUDPServer question

www.cryer.info
Managed Newsgroup Archive

Re: TidUDPServer question

Subject:Re: TidUDPServer question
Posted by:"Jamie Dale" (j.da..@turboz.net)
Date:Fri, 2 Jun 2006 23:09:00

>> I had to put the text into a public string and set a timer to read it..
>
> That is not thread-safe, unless you wrap the string with a mutex,
> semaphore,
> or critical section.  If the thread writes to the string at the same time
> that the timer is reading it, you can have unexpected behavior.
>
YEs I had thought about that previously however lucky for me my server would
typically have only myself connected. Then I came up with another way around
it: Stick the string into a dynamic array and let the timer read them one by
one ;)

Neccessity is the mother of invention and where there is a will there is a
way.

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive