The protocol used between Test Logic process and GUI server process is a simple text based protocol. The protocol is line based and protocol messages are separeted from each other by the newline ('\n') character. The basic protocol message consist of a command with some number of parameters. Whitespace characters are used between command and arguments. Here is an example:
INIT AB\nHere the protocol command is INIT, there is a space between the first parameter and the command, and the first parameter is AB. The GUI server process can also send responses to the Test Logic process using the same protocol. Here's an example:
CLOSE-ACK
This simple text based protocol was chosen because it is easy to debug interactively using text-based tools. It is also pretty simple to implement.
INIT guiname(string) QUIT
INIT command tells GUI server process to start a new GUI process. The guiname parameter is the name of the GUI to initalize, given in uppercase letters. The GUI server starts a new python interpreter with the (lowercase) guiname.py module as the Python program to be run.
The GUI names are not hardcoded, so you can add a new gui without changing anything in GUI server. All you have to do is to make sure your module is in a directory listed in the Python module load PATH (PYTHONPATH environment variable specifies it). Your module should be able to specify the socket port it uses with the -s portnumber argument. Here's an example how GUI server starts a new process:
python ab.py -s 20050
QUIT command tells GUI server process to exit, closing communication socket to Test Logic.
CLOSE-ACK
CLOSE-ACK message means that the GUI process has terminated and Test Logic can now initialize a new GUI process by sending GUI server an INIT command.