Create a Connection only once and avoid no-op if was "connected"

This commit is contained in:
Lonami Exo
2017-09-21 13:43:33 +02:00
parent 4777b8dad4
commit 2b2da843a1
6 changed files with 38 additions and 44 deletions

View File

@@ -2,6 +2,8 @@ import os
import time
from hashlib import sha1
import errno
from .. import helpers as utils
from ..crypto import AES, AuthKey, Factorization
from ..crypto import rsa
@@ -30,7 +32,6 @@ def _do_authentication(connection):
time offset.
"""
sender = MtProtoPlainSender(connection)
sender.connect()
# Step 1 sending: PQ Request
nonce = os.urandom(16)