EDIT: Looks like I found the solution here: Python SocketServer
I am testing it now to make sure it does what I am looking for. I will leave the question open for now to hear other approaches.
End Edit
I am developing a client-server system in Python.
There are multiple clients, in tens of thousands. The server will need to accept connections, receive data and process the data.
I have this part done and its working fine.
Once the server determines that all the clients sent in their data, the http server needs to shutdown, print the processed data and exit.
I am using pyjsonrpc (https://pypi.python.org/pypi/python-jsonrpc/0.3.4) to move data from client to the server.
I am using the http server example code from the above page. I am unable to figure out how to exit on demand from "http_server.serve_forever()" statement. I found some similar questions on stackoverflow but didnt help me much.
If I missed a previously answered question, please point me to it.
Thank you