Here is source code for multithreaed server and client in python.
In the code client and server closes connection after the job is finished. I want to keep the conne
For an example of a client the keeps a TCP connection open and uses a familiar protocol, look at the source of the telnetlib module. (sorry, someone else will have to answer your threading questions.)
An example of a server that keeps a TCP connection open is in the source for the SocketServer module (any standard Python installation includes the source).