SRL Archive - OSR Help

Sharing information among simbas


legoace

2011-12-05 14:45:57

Hey guys. So for my next scripting project (hopefully one that will get me membership :thumbsup:) I need to share information (variables, basically integers and strings) between two or more instances of Simba.

I'm just starting with two instances. One is a master, one is a slave. The master creates an INI and then both read it in loops to monitor it and write back to it when necessary. The only problem is when one is writing and the other tries to read (I think) I get a permissions exception.

Any suggestions? Idk if anyone has tried this before or posted about it if they have.

Nava2

2011-12-05 14:53:57

Perhaps just encase the read in a try..except construct, then loop until you can read it. Just waiting a certain time before trying again. Eventually, the read write will be allowed.

There is also a "shared" property with read/writing of files. Not sure if Simba implements it natively, though.

Dgby714

2011-12-05 15:07:30

Could use sockets? Tho the server side would be blocked tho you could make a server script and the clients can communicate thru the server.

legoace

2011-12-05 15:25:26

Wow… I never knew there was a try-except structure in pascal. Learn something new everyday.

Sockets would probably work but are slightly over my head haha! Thanks for the help guys.