|Subject:||Re: Whats the difference between TIdContext & TIdPeerThread?|
|Posted by:||Remy Lebeau (TeamB) (firstname.lastname@example.org)|
|Date:||Mon, 26 Jun 2006|
"Jamie Dale" <j.da…@turboz.net> wrote in message
> Can anyone tell me what the difference is now?
As far as your event handler code is concerned, there is very little
difference at all. Use TIdContext the same way that you used TIdPeerThread.
The differences are internal to Indy, as TIdTCPServer in Indy 10 uses a very
different threading model than Indy 9 did.
> Can I simply swap AThread to AContext in my code?
For most situations, yes.
> If so, how does it affect things like
> TIdPeerThread(AThread).Connection.WriteLn('comment'); ??
Why are you type-casting to begin with? The event handlers have the AThread
parameter typed as TIdPeerThread, so there is no need to type-cast the
parameter to a type that it already is. Just use it as-is:
Which then translates to Indy 10:
Whats the difference between TIdContext & TIdPeerThread? posted by Jamie Dale on Mon, 26 Jun 2006