diff --git a/TLSharp.Core/Network/TcpTransport.cs b/TLSharp.Core/Network/TcpTransport.cs index 254153e..31bd6b4 100644 --- a/TLSharp.Core/Network/TcpTransport.cs +++ b/TLSharp.Core/Network/TcpTransport.cs @@ -84,8 +84,17 @@ namespace TLSharp.Core.Network } return new TcpMessage(seq, body); - } - + } + + public bool IsConnected + { + get + { + return this._tcpClient.Connected; + } + } + + public void Dispose() { if (_tcpClient.Connected) diff --git a/TLSharp.Core/TelegramClient.cs b/TLSharp.Core/TelegramClient.cs index a4fa06a..825f9a7 100644 --- a/TLSharp.Core/TelegramClient.cs +++ b/TLSharp.Core/TelegramClient.cs @@ -377,8 +377,18 @@ namespace TLSharp.Core _session.SessionExpires = int.MaxValue; _session.Save(); - } - + } + + public bool IsConnected + { + get + { + if (_transport == null) + return false; + return _transport.IsConnected; + } + } + public void Dispose() { if (_transport != null)