1from socket import socket 2from threading import Condition, Lock 3from typing import Mapping, Optional, Sequence, Tuple 4 5from waitress.adjustments import Adjustments 6from waitress.buffers import OverflowableBuffer 7from waitress.parser import HTTPRequestParser 8from waitress.server import BaseWSGIServer 9from waitress.task import ErrorTask, WSGITask 10 11from . import wasyncore as wasyncore 12 13class ClientDisconnected(Exception): ... 14 15class HTTPChannel(wasyncore.dispatcher): 16 task_class: WSGITask = ... 17 error_task_class: ErrorTask = ... 18 parser_class: HTTPRequestParser = ... 19 request: HTTPRequestParser = ... 20 last_activity: float = ... 21 will_close: bool = ... 22 close_when_flushed: bool = ... 23 requests: Sequence[HTTPRequestParser] = ... 24 sent_continue: bool = ... 25 total_outbufs_len: int = ... 26 current_outbuf_count: int = ... 27 server: BaseWSGIServer = ... 28 adj: Adjustments = ... 29 outbufs: Sequence[OverflowableBuffer] = ... 30 creation_time: float = ... 31 sendbuf_len: int = ... 32 task_lock: Lock = ... 33 outbuf_lock: Condition = ... 34 addr: Tuple[str, int] = ... 35 def __init__( 36 self, server: BaseWSGIServer, sock: socket, addr: str, adj: Adjustments, map: Optional[Mapping[int, socket]] = ... 37 ) -> None: ... 38 def writable(self) -> bool: ... 39 def handle_write(self) -> None: ... 40 def readable(self) -> bool: ... 41 def handle_read(self) -> None: ... 42 def received(self, data: bytes) -> bool: ... 43 connected: bool = ... 44 def handle_close(self) -> None: ... 45 def add_channel(self, map: Optional[Mapping[int, socket]] = ...) -> None: ... 46 def del_channel(self, map: Optional[Mapping[int, socket]] = ...) -> None: ... 47 def write_soon(self, data: bytes) -> int: ... 48 def service(self) -> None: ... 49 def cancel(self) -> None: ... 50