I use WTelegramClient
. The client does not reconnect after the Internet connection is restored.
Showing this:
Connecting to 149.154.167.91:443... SocketException HostUnreachable (10065): A socket operation was attempted to an unreachable host. Connecting to [2001:67c:4e8:f004::a]:443... Connecting to 149.154.167.50:443...
After the connection has been established, transient connection losses should be detected and handled automatically by WTelegramClient:
MaxAutoReconnect
reconnection attempts, if the connection can still not be re-established, theclient.OnUpdate
event receives aReactorError
object, so you can decide what to do.Now the log you provide doesn't give much context so I presume this happens at the very beginning of opening a session with WTelegramClient.
In this case there is no automatic retry, you should just catch the connection error using a
try..catch
around theConnectAsync
orLoginUserIfNeeded
call, and decide what to do, when to retry the connection.