WSGIServer
BaseHTTPServer that implements the Python WSGI protocol
Attributes
| Attribute | Type | Description |
|---|---|---|
| request_queue_size | int = 10 | The 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
| Name | Type | Description |
|---|---|---|
| *args | any | Variable length argument list passed to the parent class constructor. |
| ipv6 | boolean = False | Flag to determine if the server should use IPv6 (AF_INET6) instead of IPv4. |
| allow_reuse_address | boolean = True | Determines whether the server allows the immediate reuse of a local address. |
| **kwargs | any | Arbitrary 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
| Name | Type | Description |
|---|---|---|
| request | socket.socket | The socket object representing the client request that encountered an error |
| client_address | tuple | The address of the client that initiated the request, typically a (host, port) tuple |
Returns
| Type | Description |
|---|---|
null | Nothing is returned; the method performs logging or triggers the default error handling mechanism. |