Indy 9
|
TIdCommandHandlers = class(TOwnedCollection)
TIdCommandHandlers is used to represent the CommandHandlers property in TIdTCPServer and descendant classes, and is accessed when a peer thread executes and command handlers are enabled.
TIdCommandHandlers overrides methods in the ancestor class that Create the collection and establish the Server that owns the collection, and Add new collection items.
property Items [AIndex: Integer]: TIdCommandHandler;
property OwnedBy: TPersistent;
OwnedBy has been introduced in Indy to provide compatibility between VCL versions where Owner was not exposed in the TOwnedCollection ancestor class, and Delphi 6. In Delphi 6, OwnedBy prevents any conflict with the Owner property in TOwnedCollection that is used for memory management, assignment, and streaming.
OwnedBy provides a read access specifier that insures the OwnedBy property is returned as a TPersistent value. This avoids internal errors and potential crashes that may occur in Delphi 5.
property Server: TIdTCPServer;
function Add: TIdCommandHandler;
constructor Create(AServer: TIdTCPServer); reintroduce;
Create also sets the Server property to the value specified in AOwner.