I have python file with httpHandler class. I use it with ThreadingMixIn as follows:
from SocketServer import ThreadingMixIn from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler Successful_Attempts = 0 Failed_Attempts = 0 class httpHandler(BaseHTTPRequestHandler): def do_POST(self): ..... class ThreadingHTTPServer(ThreadingMixIn, HTTPServer): pass and later on I initiate it as follows:
server = ThreadingHTTPServer(('localhost', PORT_NUMBER), httpHandler) print 'Started httpserver on port ' , PORT_NUMBER So as I understand, the httpHandler class, once a connection is made, is already in a different thread. I want to keep track on my threads, some sort of statistics handling. However I cant access my variables. Also, I need to lock them, so that they'll represent real values, not something undefined correctly