Add a thread to constantly read messages from the network

This commit is contained in:
Lonami Exo
2017-09-02 18:27:22 +02:00
parent 0197271f74
commit 43b79c3d36
3 changed files with 33 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
import logging
import pyaes
from time import sleep
from datetime import timedelta
from hashlib import md5
from os import path
@@ -318,7 +318,8 @@ class TelegramBareClient:
try:
self._sender.send(request)
self._sender.receive(request, updates=updates)
while not request.confirm_received:
sleep(0.1) # TODO Use a proper lock
return request.result
except ConnectionResetError: