Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
socketserver.BaseRequestHandler Class Reference
Inheritance diagram for socketserver.BaseRequestHandler:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def setup
def handle
def finish

Public Attributes

 request
 client_address
 server

Detailed Description

Base class for request handler classes.

This class is instantiated for each request to be handled.  The
constructor sets the instance variables request, client_address
and server, and then calls the handle() method.  To implement a
specific service, all you need to do is to derive a class which
defines a handle() method.

The handle() method can find the request as self.request, the
client address as self.client_address, and the server (in case it
needs access to per-server information) as self.server.  Since a
separate instance is created for each request, the handle() method
can define arbitrary other instance variariables.

Definition at line 614 of file socketserver.py.


Constructor & Destructor Documentation

def socketserver.BaseRequestHandler.__init__ (   self,
  request,
  client_address,
  server 
)

Reimplemented in idlelib.rpc.RPCHandler, and test.test_urllib2_localnet.FakeProxyHandler.

Definition at line 632 of file socketserver.py.

00632 
00633     def __init__(self, request, client_address, server):
00634         self.request = request
00635         self.client_address = client_address
00636         self.server = server
00637         self.setup()
00638         try:
00639             self.handle()
00640         finally:
00641             self.finish()

Here is the caller graph for this function:


Member Function Documentation

Reimplemented in socketserver.DatagramRequestHandler, socketserver.StreamRequestHandler, and test.test_wsgiref.MockHandler.

Definition at line 648 of file socketserver.py.

00648 
00649     def finish(self):
00650         pass
00651 
00652 
00653 # The following two classes make it possible to use the same service
00654 # class for stream or datagram servers.
00655 # Each class sets up these instance variables:
00656 # - rfile: a file object from which receives the request is read
00657 # - wfile: a file object to which the reply is written
00658 # When the handle() method returns, wfile is flushed properly
00659 

Here is the caller graph for this function:

Reimplemented in socketserver.DatagramRequestHandler, socketserver.StreamRequestHandler, and test.test_wsgiref.MockHandler.

Definition at line 642 of file socketserver.py.

00642 
00643     def setup(self):
00644         pass

Here is the caller graph for this function:


Member Data Documentation

Definition at line 634 of file socketserver.py.

Definition at line 633 of file socketserver.py.

Definition at line 635 of file socketserver.py.


The documentation for this class was generated from the following file: