MCPcopy
hub / github.com/encode/starlette / close

Method close

starlette/websockets.py:180–181  ·  view source on GitHub ↗
(self, code: int = 1000, reason: str | None = None)

Source from the content-addressed store, hash-verified

178 await self.send({"type": "websocket.send", "bytes": text.encode("utf-8")})
179
180 async def close(self, code: int = 1000, reason: str | None = None) -> None:
181 await self.send({"type": "websocket.close", "code": code, "reason": reason or ""})
182
183 async def send_denial_response(self, response: Response) -> None:
184 if "websocket.http.response" in self.scope.get("extensions", {}):

Callers 4

appFunction · 0.95
test_client_closeFunction · 0.95
__call__Method · 0.95

Calls 1

sendMethod · 0.95

Tested by 4

appFunction · 0.76
test_client_closeFunction · 0.76
__call__Method · 0.76