Module SocketServer ::
Class TCPServer
|
|
Class TCPServer
BaseServer
--+
|
TCPServer
- Known Subclasses:
-
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 |
|
__init__ (self,
server_address,
RequestHandlerClass)
Constructor. |
|
close_request (self,
request)
Called to clean up an individual request. |
|
fileno (self)
Return socket file number. |
|
get_request (self)
Get the request and client address from the socket. |
|
server_activate (self)
Called by constructor to activate the server. |
|
server_bind (self)
Called by constructor to bind the socket. |
|
server_close (self)
Called to clean-up the server. |
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_bind(self)
Called by constructor to bind the socket.
May be overridden.
-
|
address_family
-
- Type:
-
int
- Value:
|
allow_reuse_address
-
- Type:
-
bool
- Value:
|
request_queue_size
-
- Type:
-
int
- Value:
|
socket_type
-
- Type:
-
int
- Value:
|