dolik.rce wrote on Mon, 15 February 2010 01:36 |
Hello All, I would like to share one very small class I wrote. It is simple object providing mostly automatic and very easy to set up interprocess communication. Example of usage is attached as well. Basic goals:
Implemented features:
Warning: This package was not extensively tested yet, you might experience all sort of bad things from loss of information to deadlocks. It did not happen to me, but it doesn't mean it can't happen There is a high probability that I will develop this code further in future, since I wan't to use it in one of my projects. About the example app: It's a console app that does nothing else then manages a list of strings (Vector<String> internally) from a simple shell. You can display it's content (command "show"), add ("add something") and delete items ("del number"). To exit, type "quit". Nothing much, heh? The interesting part is that if you open few more instances of this application, they will all behave as if they worked with single variable (but they of course do not, they just keep their own variable in sync). And this magic is done in ~50 lines of code, out of which is ~4O lines are definitions of protocol. If you think this is interesting/useful please let me know. Suggestions for further development are welcomed too Best regards, Honza |
dolik.rce wrote on Tue, 23 February 2010 13:57 |
Hello all! Thanks Ion, let me know how did it work! Here is new version. Some little bugs were fixed and new class, IPC2, was added. This new class extends the possibilities of IPC with broadcast and client-to-client messages. The examle application was extended a bit to show new capabilities. Also user documentation is enclosed and up-to-date. The communication is implemented using polling. Related to this, I should mention that in console mode, the package uses bazaar/Timer (thanks kohait00!) and with GUI flag it uses functions from CtrlCore. And of course, I'm still opened to suggestions... Best regards, Honza |