| 45 | from syncplay.protocols import SyncClientProtocol |
| 46 | from syncplay.utils import isMacOS |
| 47 | class SyncClientFactory(ClientFactory): |
| 48 | def __init__(self, client, retry=constants.RECONNECT_RETRIES): |
| 49 | self._client = client |
| 50 | self.retry = retry |
| 51 | self._timesTried = 0 |
| 52 | |
| 53 | def buildProtocol(self, addr): |
| 54 | self._timesTried = 0 |
| 55 | return SyncClientProtocol(self._client) |
| 56 | |
| 57 | def stopRetrying(self): |
| 58 | self._client._reconnectingService.stopService() |
| 59 | self._client.ui.showErrorMessage(getMessage("disconnection-notification")) |
| 60 | |
| 61 | |
| 62 | class SyncplayClient(object): |