errno 107 socket.recv issue

Jean-Michel Pichavant jeanmichel at
Tue Feb 9 18:49:51 CET 2010

Jordan Apgar wrote:
>> JM
> each time a handler is spawned is it client specific? in other words
> when two clients send something to the server do handlers spawn for
> each of them or does everything just go into a single handler?
docstring of the example:

    The RequestHandler class for our server.

    It is instantiated once per connection to the server, and must
    override the handle() method to implement communication to the

If you want data persistant over connections, store them in your handler 

class MyTCPHandler(SocketServer.BaseRequestHandler):
    cnxNumber = 0
    def handle(self):
        # self.request is the TCP socket connected to the client = self.request.recv(1024).strip()
        # just send back the same data, but upper-cased
        cnxNumber +=1  
	print "handling connection N°%s" % cnxNumber


More information about the Python-list mailing list