BaseHTTPServer threading using SocketServer.ThreadingMixIn

Paul Rubin http
Sun Feb 20 10:09:31 EST 2005


"Tortelini" <leo.hatvani at gmail.com> writes:
> I am making custom web server using HTTPServer and want to be able to
> access it simultaneously from different computers. To achieve
> multithreading, I have been experimenting with ThreadingMixIn from
> SocketServer, but it doesn't seem to work, 

One common error is to define your class as something like:

  class myServer(HTTPServer, ThreadingMixin): ...

You have to put ThreadingMixin first, since it overrides methods of
TCPServer:

  class myServer(ThreadingMixin, HTTPServer): ...



More information about the Python-list mailing list