MCPcopy Create free account
hub / github.com/Syncplay/syncplay / manualReconnect

Method manualReconnect

syncplay/client.py:931–954  ·  view source on GitHub ↗

Trigger a manual reconnection by forcing the retry mechanism. This performs the same steps as the automatic retry function.

(self)

Source from the content-addressed store, hash-verified

929 self.reconnecting = True
930
931 def manualReconnect(self):
932 """
933 Trigger a manual reconnection by forcing the retry mechanism.
934 This performs the same steps as the automatic retry function.
935 """
936 if not self._running or not hasattr(self, '_reconnectingService'):
937 self.ui.showErrorMessage(getMessage("connection-failed-notification"))
938 return
939
940 from twisted.internet import reactor
941
942 def performReconnect():
943 # Apply the shared state reset logic
944 self._performRetryStateReset()
945
946 # Stop current service and restart it to trigger reconnection
947 if self._reconnectingService and self._reconnectingService.running:
948 self._reconnectingService.stopService()
949
950 # Restart the service to trigger a reconnection attempt
951 self._reconnectingService.startService()
952
953 # Use callLater for threading purposes as suggested
954 reactor.callLater(0.1, performReconnect)
955
956 def requireServerFeature(featureRequired):
957 def requireServerFeatureDecorator(f):

Callers 1

reconnectToServerMethod · 0.80

Calls 2

getMessageFunction · 0.90
showErrorMessageMethod · 0.45

Tested by

no test coverage detected