Stop the client. If the client is connected to a server, it is disconnected. If the client is attempting to reconnect to server, the reconnection attempts are stopped. If the client is not connected to a server and is not attempting to reconnect, then this function d
(self)
| 313 | self.eio.disconnect() |
| 314 | |
| 315 | def shutdown(self): |
| 316 | """Stop the client. |
| 317 | |
| 318 | If the client is connected to a server, it is disconnected. If the |
| 319 | client is attempting to reconnect to server, the reconnection attempts |
| 320 | are stopped. If the client is not connected to a server and is not |
| 321 | attempting to reconnect, then this function does nothing. |
| 322 | """ |
| 323 | if self.connected: |
| 324 | self.disconnect() |
| 325 | elif self._reconnect_task: # pragma: no branch |
| 326 | self._reconnect_abort.set() |
| 327 | self._reconnect_task.join() |
| 328 | |
| 329 | def start_background_task(self, target, *args, **kwargs): |
| 330 | """Start a background task using the appropriate async model. |