mirror of https://github.com/Syncplay/syncplay
Attempt to fix VLC connection issues
This commit is contained in:
parent
d3f2c43861
commit
9b90dd50a7
|
@ -50,6 +50,24 @@ class VLCProtocol(LineReceiver):
|
|||
self.factory.connected = False
|
||||
|
||||
class VLCClientFactory(ReconnectingClientFactory):
|
||||
|
||||
# http://twistedmatrix.com/documents/current/api/twisted.internet.protocol.ReconnectingClientFactory.html
|
||||
#
|
||||
initialDelay = 0.3
|
||||
maxDelay = 0.45
|
||||
maxRetries = 50
|
||||
|
||||
def startedConnecting(self, connector):
|
||||
self._playerController._client.ui.showDebugMessage("Starting to connect to VLC...")
|
||||
|
||||
def clientConnectionLost(self, connector, reason):
|
||||
self._playerController._client.ui.showDebugMessage("Connection to VLC lost: {}".format(reason))
|
||||
ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
self._playerController._client.ui.showDebugMessage("Connection to VLC failed: {}".format(reason))
|
||||
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
|
||||
|
||||
def __init__(self, playerController, vlcHasResponded, vlcLaunchedTime, vlcProcess):
|
||||
self._playerController = playerController
|
||||
self._process = vlcProcess
|
||||
|
|
Loading…
Reference in New Issue