Sometimes when the user does ctrl+c to quit, it may not quit if nothing comes on the socket. Closing the socket in the signal handler fixes this.
Later on, use this file with gtkwave. To be used to check realtime behaviour of the system.