IPv6: use hostname endpoint in client

This commit is contained in:
Alberto Sottile 2018-11-08 14:51:51 +01:00
parent 8fde98ed92
commit 68a05cb021

View File

@ -11,6 +11,7 @@ import time
from copy import deepcopy
from functools import wraps
from twisted.internet.endpoints import HostnameEndpoint
from twisted.internet.protocol import ClientFactory
from twisted.internet import reactor, task, defer, threads
@ -726,7 +727,8 @@ class SyncplayClient(object):
self._playerClass = None
self.protocolFactory = SyncClientFactory(self)
port = int(port)
reactor.connectTCP(host, port, self.protocolFactory)
self._endpoint = HostnameEndpoint(reactor, host, port)
self._endpoint.connect(self.protocolFactory)
reactor.run()
def stop(self, promptForAction=False):