🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #4875

Re: TIdPeerThread hook?

#4875
From: Paul Machiaverna
Date: Fri, 03 Dec 2004 13:53
32 lines
2269 bytes
I just found something at http://www.indyproject.org/indy/Teams/Core/Docs/Standards/Misc.html

ThreadClass property instead of AThread.Data

When writing server components with descendant thread classes, do not use AThread.Data. AThread.Data should ALWAYS be reserved for use by the application programmer. Instead a descendant thread class should be created and used with the ThreadClass property. 

Okay, that answers how to attach user data to a thread.  Now, I just have to figure out the syntax for assigning a descendant class of TIdPeerThread to TIdTCPServer::ThreadClass!  :-o

"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Paul Machiaverna" <paul.machiaverna@i-stat.com> wrote in message
>news:41af854e$1@newsgroups.borland.com...
>
>> I need to associate some "user" data to a TIdPeerThread.
>
>TIdPeerThread has a Data property for exactly that purpose.
>
>> 1) If TIdPeerThread offers a hook (pointer of type void*), the
>> data can be attached to it.
>
>See above.
>
>> 2) Create a super class with TIdPeerThread as the base.  How
>> does one tell TIdTCPServer to use these user threads?
>
>Assign the server's ThreadClass property.
>
>
>Gambit
>
>
Technical Details
Message-ID: <41b07de3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!easynet-monga!easynet.net!news.netcologne.de!newsfeed-fusi.netcologne.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41af854e$1@newsgroups.borland.com> <41af93ff$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a67b5a7da45f80f8
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Sender: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Reply-To: "Paul Machiaverna" <paul.machiaverna@i-stat.com>
Subject: Re: TIdPeerThread hook?
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 130.36.11.140     
References: <41af854e$1@newsgroups.borland.com> <41af93ff$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41b07de3$1@newsgroups.borland.com>
Date: 3 Dec 2004 06:53:23 -0700
X-Trace: newsgroups.borland.com 1102085603 207.105.83.66 (3 Dec 2004 06:53:23 -0700)
Lines: 33
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!easynet-monga!easynet.net!news.netcologne.de!newsfeed-fusi.netcologne.de!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail