mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
MtProtoPlainSender was not connecting (closes #62)
This commit is contained in:
@@ -31,13 +31,15 @@ class TcpClient:
|
||||
|
||||
def connect(self, ip, port):
|
||||
"""Connects to the specified IP and port number"""
|
||||
self.socket.connect((ip, port))
|
||||
self.connected = True
|
||||
if not self.connected:
|
||||
self.socket.connect((ip, port))
|
||||
self.connected = True
|
||||
|
||||
def close(self):
|
||||
"""Closes the connection"""
|
||||
self.socket.close()
|
||||
self.connected = False
|
||||
if self.connected:
|
||||
self.socket.close()
|
||||
self.connected = False
|
||||
|
||||
def write(self, data):
|
||||
"""Writes (sends) the specified bytes to the connected peer"""
|
||||
|
Reference in New Issue
Block a user