Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Apr : Re: Simple Indy Server doesn't receive in order

www.cryer.info
Managed Newsgroup Archive

Re: Simple Indy Server doesn't receive in order

Subject:Re: Simple Indy Server doesn't receive in order
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 2 Apr 2007 15:09:01

"Bo Berglund" <bo.berglund@telia.com> wrote in message
news:4ls213dndrl2q5eq8qh5idk8m6v46ifpn9@4ax.com...

> I have this in the object constructor:
>   FCommandResponses := TStringList.Create;
>   FCmdListLock := TCriticalSection.Create;

Indy has its own TIdThreadSafeStringList class that you could use
instead.

>     {Remove any linefeeds in the message}
>     Msg := StringReplace(Msg, #13, '', [rfReplaceAll]);
>     Msg := StringReplace(Msg, #10, '', [rfReplaceAll]);

You don't need to do that inside of the locked code, because you are
not touching the list yet.  You can do it before you lock the CS.

> Will this work (i.e. is it thread-safe)???

Yes, as long as you are accessing a valid object to begin with.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive