socketserver.BaseServer.socket

socket The socket object on which the server will listen for incoming requests.

socketserver.BaseServer.shutdown()

shutdown() Tell the serve_forever() loop to stop and wait until it does.

socketserver.BaseServer.service_actions()

service_actions() This is called in the serve_forever() loop. This method can be overridden by subclasses or mixin classes to perform actions specific to a given service, such as cleanup actions. New in version 3.3.

socketserver.BaseServer.serve_forever()

serve_forever(poll_interval=0.5) Handle requests until an explicit shutdown() request. Poll for shutdown every poll_interval seconds. Ignores the timeout attribute. It also calls service_actions(), which may be used by a subclass or mixin to provide actions specific to a given service. For example, the ForkingMixIn class uses service_actions() to clean up zombie child processes. Changed in version 3.3: Added service_actions call to the serve_forever method.

socketserver.BaseServer.server_close()

server_close() Clean up the server. May be overridden.

socketserver.BaseServer.server_bind()

server_bind() Called by the server’s constructor to bind the socket to the desired address. May be overridden.

socketserver.BaseServer.server_address

server_address The address on which the server is listening. The format of addresses varies depending on the protocol family; see the documentation for the socket module for details. For Internet protocols, this is a tuple containing a string giving the address, and an integer port number: ('127.0.0.1', 80), for example.

socketserver.BaseServer.server_activate()

server_activate() Called by the server’s constructor to activate the server. The default behavior for a TCP server just invokes listen() on the server’s socket. May be overridden.

socketserver.BaseServer.request_queue_size

request_queue_size The size of the request queue. If it takes a long time to process a single request, any requests that arrive while the server is busy are placed into a queue, up to request_queue_size requests. Once the queue is full, further requests from clients will get a “Connection denied” error. The default value is usually 5, but this can be overridden by subclasses.

socketserver.BaseServer.RequestHandlerClass

RequestHandlerClass The user-provided request handler class; an instance of this class is created for each request.