BaseHTTPServer threading using SocketServer.ThreadingMixIn

2005-02-20 Thread Tortelini
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, when I freeze code in one
instance it seems to be frozen in second one too (I experimented with
time.sleep and while 1 loop). I am using python 2.4 on Windows XP. Does
anyone have any suggestions? Do I need to create HTTPRequestHandler
class anything different from ordinary?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: BaseHTTPServer threading using SocketServer.ThreadingMixIn

2005-02-20 Thread Tortelini
It's not that, here is definition that I use:
class myWebServer(SocketServer.ThreadingMixIn,
BaseHTTPServer.HTTPServer):
  pass

code that runs server:
server = myWebServer(('', 80), myWebHTTPHandler)
LOG("Web Server starting")
server.serve_forever()

and here is shortened version of myWebHTTPHandler:
class myWebHTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler):
sys_version=""
server_version=versionString

def log_request(self, code='-', size='-'):
pass

def do_GET(self):
my GET code...

def do_POST(self):
my POST code...

-- 
http://mail.python.org/mailman/listinfo/python-list