Invoked when the WebSocket is closed. If the connection was closed cleanly and a status code or reason phrase was supplied, these values will be available as the attributes ``self.close_code`` and ``self.close_reason``. .. versionchanged:: 4.0 Added ``cl
(self)
| 453 | pass |
| 454 | |
| 455 | def on_close(self) -> None: |
| 456 | """Invoked when the WebSocket is closed. |
| 457 | |
| 458 | If the connection was closed cleanly and a status code or reason |
| 459 | phrase was supplied, these values will be available as the attributes |
| 460 | ``self.close_code`` and ``self.close_reason``. |
| 461 | |
| 462 | .. versionchanged:: 4.0 |
| 463 | |
| 464 | Added ``close_code`` and ``close_reason`` attributes. |
| 465 | """ |
| 466 | pass |
| 467 | |
| 468 | def close(self, code: Optional[int] = None, reason: Optional[str] = None) -> None: |
| 469 | """Closes this Web Socket. |