Interprocess comm - newbie query

Blitz3D Forums/Blitz3D Beginners Area/Interprocess comm - newbie query

Mikorians(Posted 2014) [#1]
Never EVER had much luck in Visual Basic 6 doing this in the past...
I come to learn that a dummy network connection is how it's done?

Ancient History: What I've used has been open text files. Tried something called DDS. I forget... Tried to SendMessage with FindWindow / FW Ex

Anyway, so writing shared files is causing 3D frame hiccup issues between my apps...
Will writeline with the network solve this if I go through all the trouble?
My messages - semaphore? - are brief.

FYI: It's for a SPECIAL force-feedback device not supported in blitz - non joystick.
Medical application.


Matty(Posted 2014) [#2]
I know this is blitz but a "regular" language like java can do this very easily...

With blitz3d you are going to have troubles with applications hogging the cpu.

However with blitzplus you may be able to do it since you can use events.


Mikorians(Posted 2014) [#3]
What I'm wondering is IF the network pipe is going to work any better than the harddrive-based one because even without any client application, there seems to be a DEFINITE frame stutter every time I issue a writeline to any open disk file.

I'm only assuming it will be because multiplayer gamedevs would be up in arms if we couldn't escape this sort of stuttering- it's significant.
So is my semaphore gonna work or am I outta luck?


Matty(Posted 2014) [#4]
I would think using network commands to communicate between two apps on same device would be much faster than opening, writing and closing a file...

However it sounds like you would be better off simply copying areas of memory between the two apps. There are windows system functions in the kernel et copy memory or something which I vaguely remember being good for this sort of thing.


Matty(Posted 2014) [#5]
Eg http://www.boost.org/doc/libs/1_41_0/doc/html/interprocess/sharedmemorybetweenprocesses.html


Mikorians(Posted 2014) [#6]
Thank you for the link, Matty, but it's not for vb.net.
I'd need a vb6 example of its use.
I note also a lack of blitz3d example.
We old timer basic types aren't as flexible as you.


Matty(Posted 2014) [#7]
Yeah...the link I was showing was more for the general idea than a specific example of how to code it.

I think this blitz code archives entry may come in handy.

http://www.blitzbasic.com/codearcs/codearcs.php?code=1180


Mikorians(Posted 2014) [#8]
That's a good list of the relevant API functions.
Now, without me crashing my system...

I might possibly be able to write a peer ap in vb6 if I had a blitz ap to examine.
All I saw was a daunting bmax post.
Does nobody else need IPC or am I the only one?
Heh.


Matty(Posted 2014) [#9]
http://www.vbforums.com/showthread.php?696123-VB6-MMapper-Memory-Mapped-File-Demo

and the google query:

vb6 memory mapped files

.... if you are after vb6 that may be a start.


Mikorians(Posted 2014) [#10]
Wow! Thanks for the VB6 sample page!
Am I going to have any trouble making the Blitz3D version?
I have a LOOSE understanding of using the decls API files (I collected them all).


Mikorians(Posted 2014) [#11]
Here we go!

-Ah, You're WELCOME.-





Mikorians(Posted 2014) [#12]
Hm. When added to my larger program, it seems to crash on exit sometimes (!)
Aha! With modern process concurrency, Blitz was 'END' ing too quickly.
My bug fix has been added to counter this!

Moreover-
Make sure to end in one of 3 ways:

1. The last thing you do.
CloseMap()
End

Or (if needed)

2. The last thing you do.
Delay 500
ExecFile f$
CloseMap()
End

Try-

3. Almost the last thing you do.
CloseMap()
Delay 1000
End

Pernicious when used in conjunction with com port.
Pre-delay before as in #2 with com port closing
-Before the delay-

ALL FYI