Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client reconnection problem #262

Closed
z6yszko opened this issue Jun 20, 2024 · 3 comments
Closed

Client reconnection problem #262

z6yszko opened this issue Jun 20, 2024 · 3 comments

Comments

@z6yszko
Copy link

z6yszko commented Jun 20, 2024

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 (Exception ex) 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?

@Igor741
Copy link

Igor741 commented Jul 2, 2024

Same problem. Anyone knows how to solve this?

@Igor741
Copy link

Igor741 commented Jul 2, 2024

For now I receiving this error in logs:

Ignoring 0x3072CFA1 because of wrong timestamp 2024-07-02 12:16:18Z (svc)

@Igor741
Copy link

Igor741 commented Jul 2, 2024

updated to version 4.1.2 and everything worked

@wiz0u wiz0u closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants