SocketServer, its offspring, and threads

darel.finkbeiner at darel.finkbeiner at
Wed Jun 4 15:45:11 CEST 2008

On May 25, 10:40 am, eliben <eli... at> wrote:
> Hello,
> I have a small wxPython application. Today I was trying to add some
> RPC capability to it, so I implemented an instance of
> SimpleXMLRPCServer that runs in a separate thread when invoked and
> answers requests.
> All went fine until I realized that I have to sometimes stop the
> server - which is where I ran into a problem. Python threads can not
> be killed after they've been started.

Why not use setDaemon( true ) on the thread running the XMLRPC
server.  When the main Python thread exits, it doesn't wait for so-
called "daemon" threads and just kills them.

Check out the "threading" module in the lib documentation

More information about the Python-list mailing list