Add "IsActive()"

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1311 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2010-09-01 00:35:41 +00:00
parent ed28927351
commit e39994c6db
4 changed files with 19 additions and 0 deletions

View File

@ -84,6 +84,7 @@ type
class function GetDescription() : string;override; class function GetDescription() : string;override;
procedure Start();override; procedure Start();override;
procedure Stop();override; procedure Stop();override;
function IsActive : Boolean; override;
end; end;
@ -303,6 +304,11 @@ begin
Result := 'WST Indy HTTP Listener'; Result := 'WST Indy HTTP Listener';
end; end;
function TwstIndyHttpListener.IsActive: Boolean;
begin
Result := FHTTPServerObject.Active;
end;
initialization initialization

View File

@ -62,6 +62,7 @@ type
class function GetDescription() : string;override; class function GetDescription() : string;override;
procedure Start();override; procedure Start();override;
procedure Stop();override; procedure Stop();override;
function IsActive : Boolean; override;
end; end;
implementation implementation
@ -248,6 +249,11 @@ procedure TwstIndyTcpListener.Stop();
begin begin
if FTCPServerObject.Active then if FTCPServerObject.Active then
FTCPServerObject.Active := False; FTCPServerObject.Active := False;
end;
function TwstIndyTcpListener.IsActive: Boolean;
begin
Result := FTCPServerObject.Active;
end; end;
end. end.

View File

@ -34,6 +34,7 @@ type
class function GetDescription() : string;virtual; class function GetDescription() : string;virtual;
procedure Start();virtual;abstract; procedure Start();virtual;abstract;
procedure Stop();virtual;abstract; procedure Stop();virtual;abstract;
function IsActive : Boolean; virtual;abstract;
procedure NotifyMessage(const AMsg : string); procedure NotifyMessage(const AMsg : string);
property OnNotifyMessage : TListnerNotifyMessage read FOnNotifyMessage write FOnNotifyMessage; property OnNotifyMessage : TListnerNotifyMessage read FOnNotifyMessage write FOnNotifyMessage;
end; end;

View File

@ -82,6 +82,7 @@ type
destructor Destroy();override; destructor Destroy();override;
procedure Start();override; procedure Start();override;
procedure Stop();override; procedure Stop();override;
function IsActive : Boolean; override;
end; end;
implementation implementation
@ -325,6 +326,11 @@ begin
inherited Destroy(); inherited Destroy();
end; end;
function TwstSynapseTcpListener.IsActive: Boolean;
begin
Result := (FServerThread <> nil) and (not FServerThread.Suspended);
end;
procedure TwstSynapseTcpListener.Start(); procedure TwstSynapseTcpListener.Start();
begin begin
if ( FServerThread = nil ) then if ( FServerThread = nil ) then