Indy 9
|
TIdAntiFreezeBase = class(TIdBaseComponent)
property Active: boolean;
Note: TIdAntiFreezeBase can only perform it's processing when the calling client is the main thread in the application and the component is Active, as indicated in ShouldUse.
property ApplicationHasPriority: Boolean;
property IdleTimeOut: integer;
property OnlyWhenIdle: Boolean;
The default value for OnlyWhenIdle is ID_Default_TIdAntiFreezeBase_OnlyWhenIdle as assigned using VCL Component streaming and the Create constructor.
constructor Create(AOwner: TComponent); override;
Only one instance of TIdAntiFreezeBase is allowed per application. If another instance already exists, an exception is raised with the RSOnlyOneAntiFreeze message. TIdAntiFreezeBase uses the global variable GAntiFreeze to determine if another instance has already been created.
Create initializes the following properties to their default values:
Note: Do not create instances of TIdAntiFreezeBase. Applications should use the TIdAntiFreeze component.
destructor Destroy; override;
It is not recommended to call Destroy directly. Call Free instead. Free checks to ensure that the object reference is not nil before calling Destroy.
class procedure DoProcess(const AIdle: boolean = true; const AOverride: boolean = false);
Set AIdle to True to force an idle state in the main thread regardless of the OnlyWhenIdle value. Set AIdle to False to use the current OnlyWhenIdle value.
Set AOverride to True to force an idle state in the main thread regardless of either AIdle or OnlyWhenIdle values. Set AOverride to False to allow use of the current values in AIdle or OnlyWhenIdle.
DoProcess calls the Process method of the global GAntiFreeze application variable. Note: TIdAntiFreezeBase can only perform DoProcess when the calling client is the main application thread and the component is Active.
procedure Process; virtual; abstract;
class function ShouldUse: boolean;
ShouldUse is called from TIdAntiFreezeBase.Sleep, as well as TIdTCPConnection descendants that implement connection timeout features like TIdTCPClient and TIdTCPServer.
class procedure Sleep(ATimeout: Integer);
When ShouldUse is False, Sleep calls IdGlobal.Sleep for ATimeout milliseconds with no additional processing.