Recent

Author Topic: Communication (IPC?) with system service  (Read 8737 times)

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
Communication (IPC?) with system service
« on: November 02, 2011, 07:55:14 pm »
Hi,

I am currently trying to set up a communications channel between a system service (Windows XP) and a GUI.

My first try was TSimpleIPC, with the server in the service (Global := True) and the client in the GUI. This seems not to work, the client always reports that the server would not be running ... looking at the source, this was not a surprise, as TSimpleIPCServer obviously creates some kind of hidden window to receive messages. On the other hand, TSimpleIPCServer instantiates successfully, indicating that this window *can*  be created ...

Can anyone confirm if there is a chance of getting SimpleIPC to work in this configuration? If not, what means of communication would you suggest under these circumstances?

Thanks :-)
Lazarus 1.2.4 on Win XP/7 Virtual Machine

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
Re: Communication (IPC?) with system service
« Reply #1 on: November 02, 2011, 08:52:11 pm »
Maybe I should add that the messages I would like to send are short strings.
Lazarus 1.2.4 on Win XP/7 Virtual Machine

cdbc

  • Hero Member
  • *****
  • Posts: 1808
    • http://www.cdbc.dk
Re: Communication (IPC?) with system service
« Reply #2 on: November 03, 2011, 05:45:08 am »
Hi

A lot of services communicate via sockets. Setting the service up as a server and the gui as client. Maybe "LNet" or "Synapse" could do the job nicely :-)

Hth - regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Communication (IPC?) with system service
« Reply #3 on: November 03, 2011, 01:09:45 pm »
As far as I remember its very easy to use mailslots. There should some examples available at least for Delphi.
Lazarus 1.7 (SVN) FPC 3.0.0

Leledumbo

  • Hero Member
  • *****
  • Posts: 8785
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Communication (IPC?) with system service
« Reply #4 on: November 04, 2011, 07:44:29 am »
Hmm... can you find anything useful in the documentation?

Eclipticon

  • Jr. Member
  • **
  • Posts: 51
Re: Communication (IPC?) with system service
« Reply #5 on: November 05, 2011, 02:28:47 pm »
Thanks for the tips with mailslots and sockets ... both look reasonable to approach my problem.

It would be nice to know though if SimpleIPC can be used for services or not ... if not, this should be added to the documentation so save others from wasting time as I did ;-)
Lazarus 1.2.4 on Win XP/7 Virtual Machine

 

TinyPortal © 2005-2018