MCPcopy
hub / github.com/Sathvik-Rao/ClipCascade / _on_ws_close

Method _on_ws_close

ClipCascade_Desktop/src/p2p/p2p_manager.py:209–225  ·  view source on GitHub ↗
(self, ws, *args)

Source from the content-addressed store, hash-verified

207 return False, msg
208
209 def _on_ws_close(self, ws, *args):
210 self.ws_client = None
211 self.is_connected = False
212 if self._suppress_auto_reconnect_once:
213 self._suppress_auto_reconnect_once = False
214 return
215 # Auto Reconnect
216 if not self.is_login_phase and not self.disconnected:
217 self.is_auto_reconnecting = True
218 if self.first_conn_lost:
219 self.notification_manager.notify(
220 title=f"{APP_NAME}: WebSocket Connection Lost ⛓️‍💥",
221 message="Check your internet connection. Retrying...",
222 )
223 self.first_conn_lost = False
224 time.sleep(RECONNECT_WS_TIMER) # seconds
225 self.connect()
226
227 def manual_reconnect(self):
228 if not self.is_auto_reconnecting:

Callers

nothing calls this directly

Calls 2

connectMethod · 0.95
notifyMethod · 0.80

Tested by

no test coverage detected