← Về thư mục
openai4s/share/ws_client.py
- WSClientError · class · L18-L19 — class WSClientError(RuntimeError)
- WSClient · class · L22-L166 — class WSClient
- init · method · L23-L26 — def init(self, sock: socket.socket) -> None
- connect · method · L30-L73 — def connect( cls, url: str, *, headers: dict[str, str] | None = None, timeout: float = 15.0, allow_insecure: bool = False, ) -> "WSClient"
- _handshake · method · L75-L113 — def _handshake( self, host: str, port: int, path: str, headers: dict[str, str] ) -> None
- _drain_error_body · method · L115-L119 — def _drain_error_body(self) -> None
- send_text · method · L122-L123 — def send_text(self, payload: bytes) -> None
- send_binary · method · L125-L126 — def send_binary(self, payload: bytes) -> None
- send_pong · method · L128-L129 — def send_pong(self, payload: bytes) -> None
- send_ping · method · L131-L132 — def send_ping(self, payload: bytes = b"") -> None
- _send · method · L134-L142 — def _send(self, payload: bytes, opcode: int) -> None
- recv · method · L144-L147 — def recv(self, *, max_len: int) -> tuple[int, bytes] | None
- settimeout · method · L149-L153 — def settimeout(self, timeout: float | None) -> None
- close · method · L155-L166 — def close(self) -> None