more IAsyncDisposable stuff

This commit is contained in:
Wizou 2024-09-07 01:59:27 +02:00
parent 9fe6a9d74f
commit be7027b318
6 changed files with 10 additions and 7 deletions

View file

@ -20,7 +20,7 @@ namespace WTelegramClientTest
}
finally
{
Client?.Dispose();
if (Client != null) await Client.DisposeAsync();
}
}
@ -42,7 +42,7 @@ namespace WTelegramClientTest
while (true)
{
Console.WriteLine("Disposing the client and trying to reconnect in 5 seconds...");
Client?.Dispose();
if (Client != null) await Client.DisposeAsync();
Client = null;
await Task.Delay(5000);
try