Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-12

Code to send message from Python script to FPC's TSimpleIPCServer

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michalis Kamburelis

Just sharing, in case someone will find the below information useful, or worthy to add to some wiki or docs anywhere:

I have here a daemon written in FPC that communicates with clients by very nice TSimpleIPCServer class (in SimpleIPC unit). Of course it's trivial to send a message to such server from another FPC program (see fcl-base/examples/ipcclient.pp). Turns out it's also trivial to send a message from a Python program. Attaching the Python code. You can probably easily add alternatives for any other programming language to this :)

Note that this is specific to Unix, where SimpleIPC just uses a named pipe, so it looks just like a writeable file (/tmp/server_name) to any other process. I don't know how it looks for other OSes.

Michalis