MCPcopy Create free account
hub / github.com/miguelgrinberg/python-socketio / shutdown

Method shutdown

src/socketio/async_client.py:334–346  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

332 await self.eio.disconnect()
333
334 async def shutdown(self):
335 """Stop the client.
336
337 If the client is connected to a server, it is disconnected. If the
338 client is attempting to reconnect to server, the reconnection attempts
339 are stopped. If the client is not connected to a server and is not
340 attempting to reconnect, then this function does nothing.
341 """
342 if self.connected:
343 await self.disconnect()
344 elif self._reconnect_task: # pragma: no branch
345 self._reconnect_abort.set()
346 await self._reconnect_task
347
348 def start_background_task(self, target, *args, **kwargs):
349 """Start a background task using the appropriate async model.

Calls 1

disconnectMethod · 0.95