This script is the heart of the entire system, and is basically a standard server with one exception: after initialization, dsplyserver.pl forks to create a child process that will become a system 'heartbeat' (Fig 3).
The parent process sets up a receive socket and blocks waiting for connections. When another process connects, the socket is read to determine which of the three types of server messages has been received: a request for a new display, a request for system status, or a data packet to be displayed. If the message is a request for a data display from a new 'listener', the socket is placed in non-blocking mode and added to a list of connections expecting data. The name of the computer requesting the display and the time of connection are also recorded. If the message is a request for system status, dsplyserver.pl returns a tab-separated list of computer names and connect times and closes the socket. If the message is neither of the types above, it is assumed to be data for display and it is forwarded to each socket in the list of current connections. If any listener fails to receive the sent data, its socket is closed and it is removed from the list.
The child process put itself to sleep for a specified period and after waking, connects to the parent's socket. It sends a single word message: "Tick", then closes the connection and goes back to sleep. This message is interpreted by the parent as data and is forwarded to every listener. This heartbeat is required in order to keep the browsers from timing out and closing their connections to the web server.