Home | Trees | Index | Help |
|
---|
Module SocketServer :: Class TCPServer |
|
BaseServer
--+
|
TCPServer
HTTPServer
Base class for various socket-based server classes. Defaults to synchronous IP stream (i.e., TCP). Methods for the caller: - __init__(server_address, RequestHandlerClass) - serve_forever() - handle_request() # if you don't use serve_forever() - fileno() -> int # for select() Methods that may be overridden: - server_bind() - server_activate() - get_request() -> request, client_address - verify_request(request, client_address) - process_request(request, client_address) - close_request(request) - handle_error() Methods for derived classes: - finish_request(request, client_address) Class variables that may be overridden by derived classes or instances: - address_family - socket_type - request_queue_size (only for stream sockets) - allow_reuse_address Instance variables: - server_address - RequestHandlerClass - socket
Method Summary | |
---|---|
Constructor. | |
Called to clean up an individual request. | |
Return socket file number. | |
Get the request and client address from the socket. | |
Called by constructor to activate the server. | |
Called by constructor to bind the socket. | |
Called to clean-up the server. | |
Inherited from BaseServer | |
Finish one request by instantiating RequestHandlerClass. | |
Handle an error gracefully. | |
Handle one request, possibly blocking. | |
Call finish_request. | |
Handle one request at a time until doomsday. | |
Verify the request. |
Class Variable Summary | |
---|---|
int |
address_family = 2 |
bool |
allow_reuse_address = False
|
int |
request_queue_size = 5 |
int |
socket_type = 1 |
Method Details |
---|
__init__(self,
server_address,
RequestHandlerClass)
Constructor. May be extended, do not override.
|
close_request(self, request)Called to clean up an individual request.
|
fileno(self)Return socket file number. Interface required by select(). |
get_request(self)Get the request and client address from the socket. May be overridden. |
server_activate(self)Called by constructor to activate the server. May be overridden.
|
server_bind(self)Called by constructor to bind the socket. May be overridden. |
server_close(self)Called to clean-up the server. May be overridden.
|
Class Variable Details |
---|
address_family
|
allow_reuse_address
|
request_queue_size
|
socket_type
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Fri Jul 27 17:40:03 2007 | http://epydoc.sf.net |