From 85fefb2d4ecc76ceb425aa22e526a3fb2419ec00 Mon Sep 17 00:00:00 2001 From: salar2k Date: Thu, 2 Mar 2017 09:52:12 +0330 Subject: [PATCH] Implementing IsConnected --- TLSharp.Core/TelegramClient.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index a4fa06a..228c9b5 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -377,8 +377,15 @@ namespace TLSharp.Core _session.SessionExpires = int.MaxValue; _session.Save(); - } - + } + + public bool IsConnected() + { + if (this._transport == null) + return false; + return this._transport.IsConnected; + } + public void Dispose() { if (_transport != null)