Close the connection.
(self)
| 70 | ) from e |
| 71 | |
| 72 | def disconnect(self) -> None: |
| 73 | """Close the connection.""" |
| 74 | if self._socket: |
| 75 | try: |
| 76 | self._socket.close() |
| 77 | except Exception: |
| 78 | pass |
| 79 | self._socket = None |
| 80 | self._buffer = b"" |
| 81 | |
| 82 | def _recv_message(self, timeout: Optional[float] = None) -> dict: |
| 83 | """Receive a single JSON message from the socket.""" |