This is an old revision of the document!
Table of Contents
Pentominos - Data Collection System
Network communication (protocol)
All network communication are done via XML documents.
Every XML document is terminated by the zero character ('\0' in c/c++)
Sending the zero character to a process will reset it, and thereby cleaning up all mess made by illegal documents.
A connection can only be created in client-mode, and will exists as long as the client intends it to.
A server listen will run in a read loop until the client terminates the connection.
The server must reply to all request with an answer, no matter if the preceding processing went well or not.
The client
The client reads its config file, and forks for each config section it encounters.
Every fork handles a single apparatus according to the attached config section.
The main thread runs infinitely and makes sure to terminate all client forks upon termination.
Every client is connected physically to a port on the host computer, and a LUA program runs to determine whether data is ready to be read or not.
The LUA programs hereafter sends this data to the server indirectly through a number of exposed c methods.
Each LUA program must run in an infinite loop, terminating only when the function stop() returns true, and it must not hang waiting on read, but rather have a time-out, and loop again.