Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Apr : Re: TIdTCPServer - threads, global data contd.

www.cryer.info
Managed Newsgroup Archive

Re: TIdTCPServer - threads, global data contd.

Subject:Re: TIdTCPServer - threads, global data contd.
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 17 Apr 2006 11:37:19

"Stephen Odgaard" <sso@cowi.dk> wrote in message
news:44418887$1@newsgroups.borland.com...

> It seems the key to 1a) and 1d) would be to maintain a TThreadlist
> of connected TIDContext's with their individual data.

Indy already does that for you.  See my other reply.

> 1c) should then be possible to perform by getting the AContext from the
> TThreadlist above and then a) either executing the AContext.OnRun event

DO NOT DO THAT.  Never ever ever ever call the events directly!

> or b)even simpler by executing AContext.Connection.IOHandler.WriteLn()

Do not do that outside of the OnExecute event handler, either, unless you
implement your own locking mechanism to prevent multiple threads from
writing to the socket at the same time.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive