Skip to content

TSimpleIPCServer

Simple IPC server component.

Declaration

Source position: simpleipc.pp line 146

type

  TSimpleIPCServer = class(TSimpleIPC)
  public
    constructor Create;
    destructor Destroy;
    procedure StartServer;
    procedure StartServer(AThreaded: Boolean);
    procedure StopServer;
    function PeekMessage : Boolean;
    function ReadMessage : Boolean;
    property StringMessage: string; {r}
    procedure GetMessageData;
    property Message: TIPCServerMsg; {r}
    property MsgType: TMessageType; {r}
    property MsgData: TStream; {r}
    property InstanceID: string; {r}
    property ThreadExecuting: Boolean; {r}
    property ThreadError: string; {r}
  published
    property Global: Boolean; {rwd}
    property OnMessage: TNotifyEvent; {rw}
    property OnMessageQueued: TNotifyEvent; {rw}
    property OnMessageError: TMessageQueueEvent; {rw}
    property OnThreadError: TNotifyEvent; {rw}
    property MaxQueue: Integer; {rwd}
    property MaxAction: TIPCMessageOverflowAction; {rwd}
    property Threaded: Boolean; {rw}
    property ThreadTimeout: Integer; {rwd}
    property SynchronizeEvents: Boolean; {rwd}
  end;

Description

TSimpleIPCServer is the server side of the simple IPC communication protocol. The server program should create a TSimpleIPCServer instance, set its ServerID property to a unique name for the system, and then set the Active property to True (or call StartServer).

After the server was started, it can check for availability of messages with the PeekMessage call, and read the message with ReadMessage.

Properties

Member Visibility Description
Global published Is the server reachable to all users or not.
InstanceID read only public Instance ID.
MaxAction published Action to take when the number of messages will exceed MaxQueue.
MaxQueue published Maximum number of messages in the queue, 0 for unlimited.
Message read only public Last read message.
MsgData read only public Last message data.
MsgType read only public Last message type.
StringMessage read only public Last message as a string.
SynchronizeEvents published Should events be run in the main thread ?
Threaded published Is the server running threaded or not ?
ThreadError read only public Last thread error.
ThreadExecuting read only public Is the message thread currently executing ?
ThreadTimeout published Timeout waiting for message.
See all Properties

Methods

Member Visibility Description
Create public Create a new instance of TSimpleIPCServer.
Destroy public Remove the TSimpleIPCServer instance from memory.
GetMessageData public Read the data of the last message in a stream.
PeekMessage public Check if a client message is available.
ReadMessage public Read message from the queue.
StartServer public Start the server.
StopServer public Stop the server.
See all Methods

Events

Member Visibility Description
OnMessage published Event triggered when a message arrives.
OnMessageError published Event called when a new message has arrived, and the queue is full.
OnMessageQueued published Event called when a new message has arrived.
OnThreadError published Triggered when a thread reports an error.
See all Events

See also

Name Description
TSimpleIPCClient Simple IPC client component.
TSimpleIPC Ancestor for client/server simple IPC classes.
TIPCServerComm Internal message communication component.