[英]Python SocketServer.TCPServer request
I've been playing around with Python's SocketServer: 我一直在玩Python的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
. 通过阅读源代码,我知道RequestHandler.__init__()
request
作为参数接收,并在self.request
保留对其的引用。
Where can I find the specifications for the request
object? 在哪里可以找到request
对象的规范?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.