This page is now obsolete. SLART has been equipped with a new inter-process communcation, which has been named "Satellite". It's based upon TCP communication with a server that's started transparently if it's not available.
Right now SLART uses UDP for sending messages from one application to another. While being very portable, the downside on this is, that every application needs an own port to listen on. The protocol run was orginally intended for bus architecture. SLARTSock is my second approach on setting up a robust communication framework. The main goals are:
When an application is run it tries to connect to a UNIX domain socket. If that socket is not available it instantiates a server on it's own and then connects to this server.
A message from a client is sent to the server, which just forwards the message to all other clients.
If the server quits or dies, the clients are aware that and try to connect to a new server which is created by one of them. And that's classic case where race conditions arise: all clients try to fire up the servers themselves simultaneously.
To circumvent this a locking mechanism is needed. I chose a dummy shared memory segment (via QSharedMemory) to accomplish this. This is no an easy task, since the Qt implementation differs a bit from system to system.
This design is not fixed in any way! If you've got any idea on how to improve the locking or replace the whole communication framework by something better, I'm open to suggestions. Feel free to drop me an email. The address is in the readme that comes with the demo code.
This is obsolete now, see conclusion below. If you're really interessted drop me an email, and I'll point you out to the sourcecode in question or put a new test/demo application here.
The demo client is the part I need help in. If you've got a platform that's not already been tested, but runs Qt 4.x please download the code, compile and test it. The application consists of three parts: debug output, an output list in the middle, and at the bottom there's an input line. What you enter on the input line should be displayed on the output list on all other clients. The debug output displays debug message from both, the server (starting with "s:") and the client (starting with "c:"). Here's the test scenario, that you should run:
If you've run the test on an architecture not mentioned before or run into problems that are not mentioned, please send me an email containing the platform you're using and how the test worked out.
Thanks in advance for your help!
The result of this research project has now been integrated into SLART. There has been a slight design change: the unix domain socket has been replaced with a TCP socket. With this all race conditions problems have vanished, the locking - originally implemented using QSharedMemory - is now done by the TCP server itself. And it runs like a charm.
|This software is free software and distributed under the
license terms of the GPL.