1 parent 8ac48c5 commit efe26bcCopy full SHA for efe26bc
1 file changed
pyrogram/connection/connection.py
@@ -21,6 +21,7 @@
21
import time
22
23
from .transport import *
24
+from ..session.internals import DataCenter
25
26
log = logging.getLogger(__name__)
27
@@ -36,16 +37,18 @@ class Connection:
36
37
4: TCPIntermediateO
38
}
39
- def __init__(self, address: tuple, proxy: dict, mode: int = 1):
40
- self.address = address
+ def __init__(self, dc_id: int, test_mode: bool, ipv6: bool, proxy: dict, mode: int = 1):
41
+ self.ipv6 = ipv6
42
self.proxy = proxy
43
+ self.address = DataCenter(dc_id, test_mode, ipv6)
44
self.mode = self.MODES.get(mode, TCPAbridged)
45
+
46
self.lock = threading.Lock()
47
self.connection = None
48
49
def connect(self):
50
for i in range(Connection.MAX_RETRIES):
- self.connection = self.mode(self.proxy)
51
+ self.connection = self.mode(self.ipv6, self.proxy)
52
53
try:
54
log.info("Connecting...")
0 commit comments