Don't do anything on .connect() if it's already connected

This commit is contained in:
Lonami Exo
2017-06-19 09:58:03 +02:00
parent daa626aa04
commit 697434be37
3 changed files with 12 additions and 0 deletions

View File

@@ -35,6 +35,9 @@ class MtProtoSender:
"""Connects to the server"""
self._transport.connect()
def is_connected(self):
return self._transport.is_connected()
def disconnect(self):
"""Disconnects from the server"""
self._transport.close()