MCPcopy Create free account
hub / github.com/EasyIME/PIME / close

Method close

python/python3/tornado/websocket.py:1417–1431  ·  view source on GitHub ↗

Closes the websocket connection. ``code`` and ``reason`` are documented under `WebSocketHandler.close`. .. versionadded:: 3.2 .. versionchanged:: 4.0 Added the ``code`` and ``reason`` arguments.

(self, code: Optional[int] = None, reason: Optional[str] = None)

Source from the content-addressed store, hash-verified

1415 )
1416
1417 def close(self, code: Optional[int] = None, reason: Optional[str] = None) -> None:
1418 """Closes the websocket connection.
1419
1420 ``code`` and ``reason`` are documented under
1421 `WebSocketHandler.close`.
1422
1423 .. versionadded:: 3.2
1424
1425 .. versionchanged:: 4.0
1426
1427 Added the ``code`` and ``reason`` arguments.
1428 """
1429 if self.protocol is not None:
1430 self.protocol.close(code, reason)
1431 self.protocol = None # type: ignore
1432
1433 def on_connection_close(self) -> None:
1434 if not self.connect_future.done():

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected