TAdvancedSingleInstance¶
Single Application instance class using file communication.
Declaration¶
Source position: advancedsingleinstance.pas line 42
type
TAdvancedSingleInstance = class(TBaseSingleInstance)
public
constructor Create;
function Start : TSingleInstanceStart;
procedure Stop;
procedure ServerCheckMessages;
procedure ClientPostParams;
function ClientPostCustomRequest : Integer;
function ClientSendCustomRequest(const aMsgType: Integer;
const aStream: TStream) : Boolean; overload;
function ClientSendCustomRequest(const aMsgType: Integer;
const aStream: TStream;
out outRequestID: Integer) : Boolean; overload;
procedure ServerPostCustomResponse;
function ClientPeekCustomResponse : Boolean;
property ID: AnsiString; {rw}
property Global: Boolean; {rw}
property OnServerReceivedCustomRequest: TSingleInstanceReceivedCustomMessage; {rw}
end;
Description¶
TAdvancedSingleInstance is a TBaseSingleInstance descendent. It implements the required functionality using the IPC mechanism of the advancedipc unit: it uses files to communicate. This ensures the mechanism works on all platforms.
Properties¶
| Member | Visibility | Description |
|---|---|---|
| Global | public | Is the instance global (for all users) or local (for the current user). |
| ID | public | The ID of this instance. |
Methods¶
| Member | Visibility | Description |
|---|---|---|
| ClientPeekCustomResponse | public | Check whether the server posted a response. |
| ClientPostCustomRequest | public | Send a custom message to the server. |
| ClientPostParams | public | Post client command-line parameters to the server. |
| ClientSendCustomRequest | public | ClientSendCustomRequest. |
| Create | public | Create a new instance of TAdvancedSingleInstance. |
| ServerCheckMessages | public | Check for incoming messages for the server. |
| ServerPostCustomResponse | public | Post a server response to the client. |
| Start | public | Start IPC communication and check the type of the application instance. |
| Stop | public | End IPC communication. |
Events¶
| Member | Visibility | Description |
|---|---|---|
| OnServerReceivedCustomRequest | public | Server event triggered when a custom request is received. |
See also¶
| Name | Description |
|---|---|
| TBaseSingleInstance | Abstract class for single application instance. |
| advancedipc | File-based inter-process communication for server-client architectures |