On 17/08/2023 20:40,
stevef@sensigent.com wrote (cross-posted from the Discussion Group):
I would like to get an example of communication between 2 programs running independently. I have a several related programs with one part dedicated to getting data from a number of sensors and processing that data, and another part handling human interaction including pushbuttons that need to be handled in real time. I realize this may be too specialized to entertain but you asked.
Not at all "too specialized", indeed there is already a pair of example programs supplied which communicate in this way:
client.bbc and
server.bbc, both in the examples/general directory.
It's possible that you didn't consider these as meeting your requirements, because 'network' communication may suggest connecting two different machines over a LAN or WAN. But it is also an excellent method of communicating between two programs running on the same machine.
You have a choice of using TCP (which is what
client.bbc and
server.bbc use) or UDP (which is what
lanchat.bbc uses) depending on the kind of communication you need.
If you can't immediately see how you might apply this, provide a specification of a simple example program that would be a better fit.