Create a centralized Connection class, replaces TcpTransport (#112)

This commit is contained in:
Lonami Exo
2017-08-28 21:23:31 +02:00
parent bc72e52834
commit fa22a3f848
8 changed files with 143 additions and 138 deletions

View File

@@ -9,12 +9,12 @@ from ..network import MtProtoPlainSender
from ..extensions import BinaryReader, BinaryWriter
def do_authentication(transport):
def do_authentication(connection):
"""Executes the authentication process with the Telegram servers.
If no error is raised, returns both the authorization key and the
time offset.
"""
sender = MtProtoPlainSender(transport)
sender = MtProtoPlainSender(connection)
sender.connect()
# Step 1 sending: PQ Request