Skip to main content

WSGIServer

BaseHTTPServer that implements the Python WSGI protocol

Attributes

AttributeTypeDescription
request_queue_sizeint = 10The maximum number of queued connections passed to the listen() system call before the server starts refusing new requests.

Constructor

Signature

def WSGIServer(
*args: any,
ipv6: boolean = False,
allow_reuse_address: boolean = True,
**kwargs: any
) - > null

Parameters

NameTypeDescription
*argsanyVariable length argument list passed to the parent class constructor.
ipv6boolean = FalseFlag to determine if the server should use IPv6 (AF_INET6) instead of IPv4.
allow_reuse_addressboolean = TrueDetermines whether the server allows the immediate reuse of a local address.
**kwargsanyArbitrary keyword arguments passed to the parent class constructor.

Methods


handle_error()

@classmethod
def handle_error(
request: socket.socket,
client_address: tuple
) - > null

Handles an error that occurs during the processing of a request, specifically suppressing full stack traces for broken pipe errors to reduce log noise.

Parameters

NameTypeDescription
requestsocket.socketThe socket object representing the client request that encountered an error
client_addresstupleThe address of the client that initiated the request, typically a (host, port) tuple

Returns

TypeDescription
nullNothing is returned; the method performs logging or triggers the default error handling mechanism.