mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
sets the _looping flag to true right from the constructor so if Close() is called before the loop starts, the client will never loop for events.
This commit is contained in:
parent
4c112086aa
commit
8180ee94f0
|
|
@ -31,7 +31,7 @@ namespace TLSharp.Core
|
||||||
private Session _session;
|
private Session _session;
|
||||||
private List<TLDcOption> dcOptions;
|
private List<TLDcOption> dcOptions;
|
||||||
private TcpClientConnectionHandler _handler;
|
private TcpClientConnectionHandler _handler;
|
||||||
private bool _looping;
|
private bool _looping = true;
|
||||||
|
|
||||||
public delegate void UpdatesEvent (TelegramClient source, TLAbsUpdates updates);
|
public delegate void UpdatesEvent (TelegramClient source, TLAbsUpdates updates);
|
||||||
public delegate void ClientEvent(TelegramClient source);
|
public delegate void ClientEvent(TelegramClient source);
|
||||||
|
|
@ -131,7 +131,6 @@ namespace TLSharp.Core
|
||||||
logger.Trace("Entered loop");
|
logger.Trace("Entered loop");
|
||||||
var lastPing = DateTime.UtcNow;
|
var lastPing = DateTime.UtcNow;
|
||||||
await SendPingAsync();
|
await SendPingAsync();
|
||||||
_looping = true;
|
|
||||||
while (_looping)
|
while (_looping)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue