ilyalatt / Telega

C# Telegram MTProto Client
https://ilyalatt.github.io/Telega/
MIT License
58 stars 15 forks source link

Disconnect after several hours/minutes #75

Closed derodevil closed 2 years ago

derodevil commented 2 years ago

It can't update new incoming message after serveral hours/minutes (not know exactly). I use ping every 20 seconds and it doesn't help, still can't receive new incoming message. This is the code:

await tg.Call(new Telega.Rpc.Dto.Functions.Ping(10000));

What is the proper way to avoid disconnection?

ilyalatt commented 2 years ago

Looks like the same bug as #62. Probably an unhandled exception in the receive loop. Try to place try catch there and log the exception.