Reputation: 136151
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