SRL Archive - Research & Development Lounge

Communicating in-between two actively running SIMBA's on the same computer?


Fitta

2014-12-10 19:01:25

Easiest way to communicate between two SIMBA's on one computer? (NO NETWORK STUFF).
I need a string passed from one SIMBA to another..

My first and only thought was using WriteFile / ReadFile?

Ideas? :)

NKN

2014-12-10 19:05:44

Should really use sockets though.

KeepBotting

2014-12-10 19:06:29

I posted a thread on this a long time ago. If I can dig it up, I'll edit my post with the link.

Easiest way I've found is to use INI files. ReadINI and WriteINI are inbuilt functions that work well for it.

From: NKN
Should really use sockets though.
I think this is the thread containing the best example of how to use sockets

We really should look into how SCAR used SendInterSCARMessage / RecieveInterSCARMessage - I'm seeing a need for this more and more.

Edit: found my thread, https://villavu.com/forum/showthread.php?t=106722 (now that I read over it, it's actually not that useful lol)

Fitta

2014-12-10 19:19:33

From: NKN
Should really use sockets though.


From: Fitta
(NO NETWORK STUFF)


…



From: KeepBotting
I posted a thread on this a long time ago. If I can dig it up, I'll edit my post with the link.

Easiest way I've found is to use INI files. ReadINI and WriteINI are inbuilt functions that work well for it.

I think this is the thread containing the best example of how to use sockets

We really should look into how SCAR used SendInterSCARMessage / RecieveInterSCARMessage - I'm seeing a need for this more and more.

Edit: found my thread, https://villavu.com/forum/showthread.php?t=106722 (now that I read over it, it's actually not that useful lol)


Found that while searching, shame it's not in there!

KeepBotting

2014-12-10 19:23:01

From: Fitta
…

Found that while searching, shame it's not in there!


Yeah, it is a shame :(

If you're that vehemently opposed to using sockets then file I/O is pretty much the only option left :P

documentation

I believe the function is used in a way similiar to this:

WriteINI('Subsection', 'Key', 'String', AppPath + '/path/to/the/ini/file.ini');

Where Subsection is the subsection you're writing to (in the INI itself),
Key is the key you're writing to (in the subsection of the INI),
String is actually what you're writing to the key,
And the path is self-explanatory

NKN

2014-12-10 19:33:43

From: Fitta
…





Found that while searching, shame it's not in there!


Which is why I said SHOULD use, not use them.

I thought that was pretty clear.

Fitta

2014-12-10 19:41:57

From: KeepBotting
Yeah, it is a shame :(

If you're that vehemently opposed to using sockets then file I/O is pretty much the only option left :P

documentation

I believe the function is used in a way similiar to this:

WriteINI('Subsection', 'Key', 'String', AppPath + '/path/to/the/ini/file.ini');

Where Subsection is the subsection you're writing to (in the INI itself),
Key is the key you're writing to (in the subsection of the INI),
String is actually what you're writing to the key,
And the path is self-explanatory


Already done with but with WriteFileString, works like a charm!

From: NKN
Which is why I said SHOULD use, not use them.

I thought that was pretty clear.


No internet on the computer.. if that was unclear from my two posts.

Frement

2014-12-10 19:45:53

From: Fitta
Already done with but with WriteFileString, works like a charm!



No internet on the computer.. if that was unclear from my two posts.


And? You can connect via socket to the other process just fine.

KeepBotting

2014-12-10 19:49:28

From: Fitta
Already done with but with WriteFileString, works like a charm!



No internet on the computer.. if that was unclear from my two posts.


Awesome :)

you can socket without an internet connection btw, since you run a 3rd instance of Simba as the server and obviously it's being run on the localhost

it could be run on a remote computer of course but from the sound of your posts I didn't think you needed to use it in that capacity

Fitta

2014-12-10 19:57:44

really? :spongebob:

Sorry for shutting you down @NKN

Brandon

2014-12-10 20:26:40

I was under the impression @Olly; had added something to Simba for shared memory communication.. Either that or one of his plugins does it :S

That would be the best option actually. Then local host sockets. After that, you're down to using files :l

Olly

2014-12-10 20:34:08

From: Brandon
I was under the impression @Olly; had added something to Simba for shared memory communication.. Either that or one of his plugins does it :S

That would be the best option actually. Then local host sockets. After that, you're down to using files :l


Nope, my libMufasaLayer just has it.

3Garrett3

2014-12-11 10:21:27

I agree that you should use something other than INI files for communicating. I know someone on IRC a month ago was talking about crashing Simba by reading/writing a file at the same time from multiple Simbas. Or something along those lines. It's good for saving settings and stuff but files are not really a good way to go about communicating between Simbas. Sockets sound like the simplest way to go about it.

bg5

2014-12-17 21:03:44

I suggest communication throught RAM not Hard Drive. Sockets would be the best.

Either, if you just want to run 2 scripts at time why not to run them in one Simba in 2 tabs? I've made once a plugin to share data between tabs: https://villavu.com/forum/showthread.php?t=107221