PyDocs

Nav

Internet Protocols and Support

BaseRequestHandler

socketserver

class (source) not WASI
  • BaseRequestHandler(request, client_address, server)
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 other arbitrary instance variables.
Members of BaseRequestHandler

c

client_address
Client address returned by BaseServer.get_request().

f

finish
Called after the handle() method to perform any clean-up actions required.

h

handle
This function must do all the work required to service a request.

r

request
The new socket.socket object to be used to communicate with the client.

s

server
BaseServer object used for handling the request.
setup
Called before the handle() method to perform any initialization actions required.
0 Examples
No examples for socketserver/BaseRequestHandler.
See Also
No see-alsos for socketserver/BaseRequestHandler
0 Notes
No notes for BaseRequestHandler