diff --git a/mtproto.py b/mtproto.py index d077fbbe..7584062c 100644 --- a/mtproto.py +++ b/mtproto.py @@ -174,14 +174,12 @@ class Session: """ Reading socket and receiving message from server. Check the CRC32 and """ - packet_length_data = self.sock.recv(4) + packet_length_data = self.sock.recv(4) # reads how many bytes to read + if len(packet_length_data) > 0: # if we have smth. in the socket packet_length = struct.unpack("