Getting info from external application

BlitzMax Forums/BlitzMax Beginners Area/Getting info from external application

Hardcoal(Posted 2012) [#1]
How can I create a data betwin two running blitzmax application.
should I use network or is there another way


ima747(Posted 2012) [#2]
How much data do you need to share, how quickly, how frequently, how independently? Can you rely on a NIC to always be available and no internal interference such as a firewall?

One common solution is to share files through a swap location. Pro: it's easy, it's reliable, the applications can run independently and share their information even when closed since the files are accessible. Con: it's slow, if you write a lot you can thrash the disc.

You could use a network loop back. Pro: if you already have networking setup and know how to handle it it could be minimally difficult, if you configure it appropriately you could run the applications on multiple computers rather than both being on the same computer. Con: Networking can be tricky if you're not familiar with it, you're putting overhead on the NIC, if the NIC is not present (uncommon these days) or there is something monitoring it (like a firewall, very very common) then you could have connectivity issues.

You could use IO pipes. Pro: fast, usually relatively simple. Con: Sometimes it can be a royal pain to get the pipes set up properly, I've personally never gotten it to work right in blitzmax, possibly some security warnings and hassles on some OS's

There are more OS dependent approches as well but generally they require some level of toolbox access that would require a module, or at least writing some C as they aren't built into blitzmax.

Last edited 2012


ImaginaryHuman(Posted 2012) [#3]
Someone on here I think GreyAlien had some code for inter-process communication ie two apps sharing some memory.


SystemError51(Posted 2012) [#4]
I'd be interested in that IPC as well.


Hardcoal(Posted 2012) [#5]
Ill tell you my general Idea is and lets see what you guys think.

I want to make a Media Selector.
I mean an app that represent all sorts of medias
from Image to Mesh and sounds.
this is for a map editor use mainly.

I think if ill make it a stand alone App i will no longer need to recreate it everytime I use another launguage.
I will just comunicate with it.
so no need for big speed.
all i need is a way to connect betwin two apps. a way that can be done in any launguage.

it will be also be good for other people who want such a thing as a stand alone.

i would really be glad to see a simple sample of communication betwin apps.
I think network is the best way because its a common launguage of communication and not too complicated.

I also want to lets say drag an image from the MediaManager that i will make
and then to the seperate mapeditor that im making and it will know im dragging it from the media manager.

any way if you think networking is not the right way please tell me.

Last edited 2012


ziggy(Posted 2012) [#6]
Hardcoal: For this scenario, I would use Pipes. Take a look to the MaxIde source to see how it deals with the external compiler and gets data from it. You can also send data to it (see how the debuger works). It's a bit complicated at the begining but, in the long run, when you just get used to it, it becomes fairly simple.


Hardcoal(Posted 2012) [#7]
Tnx Ziggy Ill check it out


xlsior(Posted 2012) [#8]
It's also possible to share a block of memory between two applications, and have them exchange information that way -- there's been some code posted to the forums that can do that a few years ago, may be able to find it with Google?


Zeke(Posted 2012) [#9]
http://www.blitzbasic.com/Community/posts.php?topic=65705#734079


ima747(Posted 2012) [#10]
A media server like that is essentially a database and an interface to communicate with it. Personally I would write the media manager in PHP and host it on a web server along with the media assets. Here's why
1) You can communicate with it from any program, you just need to talk to the web server, make requests, etc. this is pretty common these days so it's quite easy in most languages.
2) Since it's hosted externally any number of programs *and users* can use it simultaneously. Your graphics people can upload things while the coders are implementing things while the sound people do their thing.
3) Since it's web based you can create web based front ends for managing it. That takes the management tools and makes them available on any platform with a web browser.
4) Off loading the storage and management means it's all in one location for easier backup and easier management. Less chance for things to get out of sync (which version of that model was this?).