From 28803412c1e850a3dd404db2270b9030f12e8c72 Mon Sep 17 00:00:00 2001
From: Wizou <11647984+wiz0u@users.noreply.github.com>
Date: Sun, 23 Jan 2022 14:42:35 +0100
Subject: [PATCH] FAQ about "connection shutdown"
---
.github/dev.yml | 2 +-
.github/release.yml | 2 +-
FAQ.md | 22 ++++++++++++++++++++++
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/.github/dev.yml b/.github/dev.yml
index c69b98d..4bbcd13 100644
--- a/.github/dev.yml
+++ b/.github/dev.yml
@@ -2,7 +2,7 @@ pr: none
trigger:
- master
-name: 1.9.5-dev.$(Rev:r)
+name: 2.0.0-dev.$(Rev:r)
pool:
vmImage: ubuntu-latest
diff --git a/.github/release.yml b/.github/release.yml
index 96cf785..b6d49b0 100644
--- a/.github/release.yml
+++ b/.github/release.yml
@@ -1,7 +1,7 @@
pr: none
trigger: none
-name: 1.9.$(Rev:r)
+name: 2.0.0
pool:
vmImage: ubuntu-latest
diff --git a/FAQ.md b/FAQ.md
index 5f9b53d..54cd6d6 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -160,6 +160,28 @@ or if you are connected to a Test DC (a Telegram datacenter server for tests) in
To help determine if `chats.chats` is empty or does not contain a certain chat, you should [dump the chat list to the screen](EXAMPLES.md#list-chats)
or simply use a debugger: Place a breakpoint after the Messages_GetAllChats call, run the program up to there, and use a Watch pane to display the content of the chats.chats dictionary.
+
+#### 10. I get "Connection shut down" errors in my logs
+
+There are various reasons why you may get this error. Here are the explanation and how to solve it:
+
+1) On secondary DCs *(DC used to download files)*, a Connection shut down is considered "normal"
+Your main DC is the one WTelegramClient connects to during login. Secondary DC connections are established and maintained when you download files.
+The DC number for an operation or error is indicated with a prefix like "2>" on the log line.
+If Telegram servers decide to shutdown this secondary connection, it's not an issue, WTelegramClient will re-established the connection later if necessary.
+
+2) Occasional connection shutdowns on the main DC should be caught by WTelegramClient and the reactor should automatically reconnect to the DC
+*(up to `MaxAutoReconnects` times)*.
+This should be transparent and pending API calls should automatically be resent upon reconnection.
+You can choose to increase `MaxAutoReconnects` if it happens too often because your Internet connection is unstable.
+
+3) If you reach `MaxAutoReconnects` disconnections, then the **Update** event handler will receive a `ReactorError` object to notify you of the problem.
+In this case, the recommended action would be to dispose the client and recreate one
+
+4) In case of slow Internet connection or if you break in the debugger for some time,
+you might also get Connection shutdown because your client couldn't send Pings to Telegram in the alloted time.
+In this case, you can use the `PingInterval` property to increase the delay between pings *(for example 300 seconds instead of 60)*.
+
## Troubleshooting guide