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

Method shutdown

src/socketio/client.py:315–327  ·  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

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.

Callers 7

stopMethod · 0.45
rMethod · 0.45
shutdownFunction · 0.45
wrappedFunction · 0.45

Calls 1

disconnectMethod · 0.95

Tested by 6

rMethod · 0.36
shutdownFunction · 0.36
wrappedFunction · 0.36