Problem with

Laurent Pointal laurent.pointal at
Thu May 3 09:25:24 EDT 2001


I have a small Python 2.1 server script, using BaseHTTPServer and
SocketServer, which get datas from a mapped memory and make them
available via HTTP protocol. 

It works nice. I tried up to 4 concurrent clients making continuous
requests, they work... at 99.99%. 

Time to time, I have the following bug:

Exception in thread Thread-603:
Traceback (most recent call last):
  File "c:\python21\lib\", line 378, in __bootstrap
  File "c:\python21\lib\", line 366, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "c:\python21\lib\", line 246, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "c:\python21\lib\", line 495, in __init__
  File "c:\python21\lib\", line 258, in handle
    self.raw_requestline = self.rfile.readline()
  File "c:\python21\lib\", line 233, in readline
    new = self._sock.recv(self._rbufsize)
AttributeError: 'int' object has no attribute 'recv'

My server is created like that:

class MemHTTPServer (SocketServer.ThreadingMixIn,
	    	    	BaseHTTPServer.HTTPServer) : 

class MemRequestHandler (BaseHTTPServer.BaseHTTPRequestHandler) :
    def do_GET(self) : is my processing code...

def StartMemHTTPServer (addr="",port=80) :
    global g_server
    g_server = MemHTTPServer((addr,port),MemRequestHandler)

Have you already seen such a problem?



More information about the Python-list mailing list