Hi Folks, I have been playing with the two SimpleIPC components on the Lazarus System Tab without any success. In its simplest form, here is what I am doing -
procedure TForm1.FormShow(Sender: TObject);
begin
SimpleIPCClient1.ServerID:='tomboy-ng';
SimpleIPCServer1.ServerID:='tomboy-ng';
if SimpleIPCClient1.ServerRunning then begin
Label1.Caption := 'I am a client';
SimpleIPCClient1.Active := true;
SimpleIPCClient1.SendStringMessage('SHOWSEARCH');
end else begin
Label1.Caption := 'I am a server';
SimpleIPCServer1.Global:=True; // anyone can connect
SimpleIPCServer1.Active := true; // start listening
end;
end;
procedure TForm1.SimpleIPCServer1Message(Sender: TObject);
begin
SimpleIPCServer1.ReadMessage;
Label1.Caption := SimpleIPCServer1.StringMessage;
end;
I have used the Object Inspector to create the event. Running two instances, the first becomes the 'server' and the second becomes the 'client'. The client sends a message to the server. In practice, the client does recognise that there is a server present, good, and apparently sends it's message but the Server never responds.
Have I missed something ? Documentation is a bit sparse but seems to indicate thats all I need. I am wondering if more modern forms of Linux block what ever communication channel these components use ? Likely given our interests in security. I can do the same thing with DBus (only on linux) but it seems overkill if this simple approach does work.
I have attached my minimalist project.
Davo