You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with the client's reconnection process. If a Client.OnOther event related to ReactorError occurs, the following code works correctly:
Console.WriteLine("Disposing the client and trying to reconnect in 5 seconds...");
Client?.Dispose();Client=null;await Task.Delay(5000);try{await CreateAndConnect();break;}catch(Exceptionex)when(ex is not ObjectDisposedException){
Console.WriteLine("Connection still failing: "+ ex.Message);}
However, when there is an interruption in the internet connection, the Client.OnOther event is not triggered. The client then assumes the status of Disconnected. After restoring the internet connection, the client remains Disconnected. In this case, attempting to run the above code results in an error:
The process cannot access the file '...\WTelegram.session' because it is being used by another process.
In such a case, the command client.LoginUserIfNeeded(); also does not restore the connection. Do you know of any solution?
The text was updated successfully, but these errors were encountered:
I encountered an issue with the client's reconnection process. If a Client.OnOther event related to ReactorError occurs, the following code works correctly:
However, when there is an interruption in the internet connection, the Client.OnOther event is not triggered. The client then assumes the status of Disconnected. After restoring the internet connection, the client remains Disconnected. In this case, attempting to run the above code results in an error:
The process cannot access the file '...\WTelegram.session' because it is being used by another process.
In such a case, the command
client.LoginUserIfNeeded();
also does not restore the connection. Do you know of any solution?The text was updated successfully, but these errors were encountered: