Hello. I'm writing simple app that connects to the telegram server and requests members count of channel and do some other stuff. I want the application to work constantly and when the connection is broken, it will reconnect automatically.
After 8..24 hours i get an exception in GetUserDialogsAsync function:
System.AggregateException: One or more errors occurred. (Not connected!) ---> System.InvalidOperationException: Not connected! at TLSharp.Core.TelegramClient.RequestWithDcMigration(TLMethod request) at TLSharp.Core.TelegramClient.SendRequestAsync[T](TLMethod methodToExecute) at TLSharp.Core.TelegramClient.GetUserDialogsAsync(Int32 offsetDate, Int32 offsetId, TLAbsInputPeer offsetPeer, Int32 limit) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at Coworkings.UserClient.GetChannelInfo(String channelName) in C:\Develop\CoworkingBot\CoworkingBot\Clients\UserClient.cs:line 227`
Hello. I'm writing simple app that connects to the telegram server and requests members count of channel and do some other stuff. I want the application to work constantly and when the connection is broken, it will reconnect automatically. After 8..24 hours i get an exception in GetUserDialogsAsync function:
System.AggregateException: One or more errors occurred. (Not connected!) ---> System.InvalidOperationException: Not connected! at TLSharp.Core.TelegramClient.RequestWithDcMigration(TLMethod request) at TLSharp.Core.TelegramClient.SendRequestAsync[T](TLMethod methodToExecute) at TLSharp.Core.TelegramClient.GetUserDialogsAsync(Int32 offsetDate, Int32 offsetId, TLAbsInputPeer offsetPeer, Int32 limit) --- End of inner exception stack trace --- at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification) at Coworkings.UserClient.GetChannelInfo(String channelName) in C:\Develop\CoworkingBot\CoworkingBot\Clients\UserClient.cs:line 227`Ok, in case of errors i try to reconnect:
But it doesn't work. Reconnect() returns true, but client.GetUserDialogsAsync() throw exception again.