Adam Matan
Adam Matan

Reputation: 136151

Python SocketServer.TCPServer request

I've been playing around with Python's SocketServer:

#!/usr/bin/python

import SocketServer

class EchoHandler(SocketServer.BaseRequestHandler):
    def handle(self):
        data=self.request.recv(1024)
        self.request.send(data)

HOST, PORT = "localhost", 9999
server = SocketServer.TCPServer((HOST, PORT), TCPEchoServer)
server.serve_forever() 

From reading the source, I know that RequestHandler.__init__() receives request as a parameter and keeps a reference to it in self.request.

Where can I find the specifications for the request object?

Upvotes: 5

Views: 3146

Answers (1)

phihag
phihag

Reputation: 287775

In the documentation of RequestHandler.handle.

Upvotes: 2

Related Questions