MCPcopy Create free account
hub / github.com/encode/starlette / WebSocketClose

Class WebSocketClose

starlette/websockets.py:196–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194
195
196class WebSocketClose:
197 def __init__(self, code: int = 1000, reason: str | None = None) -> None:
198 self.code = code
199 self.reason = reason or ""
200
201 async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
202 await send({"type": "websocket.close", "code": self.code, "reason": self.reason})

Callers 3

__call__Method · 0.90
__call__Method · 0.90
not_foundMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected