IPC - Inter Process Communication - How can be achieved in Harbour ?

229 views
Skip to first unread message

Pritpal Bedi

unread,
Aug 11, 2023, 9:47:00 PM8/11/23
to Harbour Users
Hi All

I am deep into a task where IPC seems the most efficient way where I need two Harbour applications communicating with each other - text only - without setting-up a server like netio or so.

I tried with hbtcpio but seems it has different use case.


Ptitpal Bedi
a student of software analysis & concepts

Ash

unread,
Aug 12, 2023, 7:25:03 AM8/12/23
to Harbour Users
Hello Pritpal,

Use a common folder. Process A leaves an agreed upon named text file for process B to detect, read and delete the file, and vice versa.

Regards,
Ash

Francesco Perillo

unread,
Aug 12, 2023, 8:39:55 AM8/12/23
to harbou...@googlegroups.com
You may also use a dbf as a queue.... if the server has a folder... it may be a raspberry booting from sd...

I'd grep harbour source code to check if something is already present...
Here a list of functions to check





--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/6114acc9-747c-43e3-a899-a5ff1f987593n%40googlegroups.com.

Pritpal Bedi

unread,
Aug 12, 2023, 3:39:34 PM8/12/23
to Harbour Users
Hi Ash

I am using this method effectively but want to have a non-disk operation solution. The usage is Harbour/HbQt based applications. Qt has a QFileSystemWatcher class which works like a charm.

Thanks 
Pritpal Bedi
a student of software analysis & concepts


Leonardo Machado

unread,
Aug 14, 2023, 9:41:24 AM8/14/23
to Harbour Users
I also needed something like this.
At the moment I'm using a disk file, but I confess it's not the best way.
I also tried using operating system environment variables (in my case there was little information to be changed.)

Leonardo Machado

Giovany Vecchi

unread,
Aug 14, 2023, 6:36:25 PM8/14/23
to Harbour Users
If it's for small data I advise using Hb_Socket.
To control concurrent access use everything object oriented.

David Field

unread,
Aug 14, 2023, 9:36:58 PM8/14/23
to Harbour Users
Hello Pritpal,

If you program is running under Windows, you can send from program A to program B a message using PostMessage with a user define message that would be understood by program B to execute some routine... but if you need to pass along text information, I don't see any other way than to use a disk operation solution.

   IF IsExeRunning( ProgramB )           // Si el programa ya está corriendo
      If (hWnd := FindWindow("window_name_of_Prog_B")) <> 0    // encontrar hWnd
            PostMessage(hWnd, <User_Message>, 0,0)   // Enviar mensaje al progama
...

Regards,
David Field

Hurricane

unread,
Aug 14, 2023, 10:05:21 PM8/14/23
to Harbour Users
are the applications on the same computer?
are the apps on the same network?
what operating systems are involved?

The following IPC mechanisms are supported by Windows:

Regards,
Hurricane
Software developer
Training, general development

Message has been deleted

Auge & Ohr

unread,
Aug 15, 2023, 3:58:20 AM8/15/23
to Harbour Users
hi,

there is a File from Phil Ide using Xbase++ and Ot4xb called XbPipes.zip
but i can not attach it here in Google Group
---
have search at https://blog.xbwin.com/ but i can not find Sample 

in German Xbase++ Forum there are Files from Pablo / Devcon 2007
https://www.xbaseforum.de/viewtopic.php?f=16&t=9480

download WinAPIWorkShop.zip and have a look into \WinAPIWorkShop\TestTRunProcess\

Jimmy

Reply all
Reply to author
Forward
0 new messages