Indy 9
|
TIdSocketHandles = class(TOwnedCollection)
The bindings must meet the following criterion:
TIdSocketHandles is a TOwnedCollection descendant that maintains additional information about the ItemClass (TIdSocketHandle) for Items contained in the collection.
TIdSocketHandles contains the DefaultPort number to assign to new TIdSocketHandle instances added to the collection.
property DefaultPort: integer;
Note: Many values of DefaultPort are associated, by convention, with a particular service such as ftp or http.
property Items [Index: Integer]: TIdSocketHandle;
function Add: TIdSocketHandle; reintroduce;
Add relies on the inherited Add method, and casts the new instance to the appropriate ItemClass (TIdSocketHandle) prior to exiting the method. Add assigns the value in DefaultPort to Port property of the new instance. Add returns the new collection item.
function BindingByHandle(const AHandle: TIdStackSocketHandle): TIdSocketHandle;
The return value for BindingByHandle will be Nil if the socket binding specified by AHandle does not exist in the collection.
constructor Create(AOwner: TComponent); reintroduce;
Note: If an exception is raised in the constructor, the Destroy destructor is called to clean up the failed instance.