I've built a very simple TCP server (in python) that when queried, returns various system level statistics of the host OS running said script.
As part of my experimentation and goal to gain knowledge of python and its available libraries; i would like to build on an administration interface that a) binds to a separate TCP socket b) accepts remote connections from the LAN and c) allows the connected user to issue various commands. The Varnish application is an example of a tool that offers similar administrative functionality.
My knowledge of threads is limited, and I am looking for pointers on how to accomplish something similar to the following :
user connects to admin port (telnet remote.host 12111), and issues "SET LOGGING DEBUG", or "STOP SERVICE".
My confusion relates to how i would go about sharing data between threads. If the service is started on for example thread-1 , how can i access data from that thread?
Alternatively, a list of python applications that offer such a feature would be a great help. I'd gladly poke through code, in order to reuse their ideas.