2Way App Communication

BlitzMax Forums/BlitzMax Programming/2Way App Communication

Thareh(Posted 2007) [#1]
Hi :)
I'm going to create an application, which needs to have 2 executables running at the same time, and I need both of them to be able to write and recieve from the other one.

I've used search and found PUB.FreeProcess, but all the examples are only a 1 way communication.

Anyone care to explain how to do this?
If it's even possible, but it should be :P

Thanks


TartanTangerine (was Indiepath)(Posted 2007) [#2]
Look for Mutex, Shared Memory and Messaging.


GW(Posted 2007) [#3]
You can use sockets to do it.
You can also use shared memory through a dll.
sockets is the most common though.


xlsior(Posted 2007) [#4]
You can also use shared memory through a dll.


Or Budman's shared memory code without a DLL:




Thareh(Posted 2007) [#5]
Aight, Thanks a bunch mates, I'll go for the Sockets method tho, seems easiest.

Thanks again :)


FlameDuck(Posted 2007) [#6]
Or Budman's shared memory code without a DLL:
But then has a huge potential (as far as I can see) for concurrency issues.

Use Sockets.


Picklesworth(Posted 2007) [#7]
If you're on Linux, use d-bus.
Lots of choices :)


Dreamora(Posted 2007) [#8]
Write usefull data into the shared memory and you don't have any problems.

ie write the "target" as first byte in and only that app reads out the data that needs it.

As the memory itself will handle concurrent accesses, you won't get any of the regular lockup issues.


Winni(Posted 2007) [#9]
It's not a democratic decision to be made, but I also vote for sockets.


FlameDuck(Posted 2007) [#10]
As the memory itself will handle concurrent accesses,
No it won't.


Thareh(Posted 2007) [#11]
Thanks for the replys! I'll go with the Sockets anyway, seems easiest and will give me an extra feature, to use the two applications on 2 different computers, creating more stability.

By the way,
Does anyone know how to execute an .exe file without the .exe file closing when I close the application that opened the file?

Thanks again :)