diff --git a/README.md b/README.md index 5b0fcc8..7292629 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ ## _a Telegram Client API library written 100% in C# and .NET Standard_ +This ReadMe is a quick but important tutorial to learn the fundamentals about this library. Please read it all. + # How to use >⚠️ This library relies on asynchronous C# programming (`async/await`) so make sure you are familiar with this advanced topic before proceeding. diff --git a/src/Client.cs b/src/Client.cs index 6d5f8fb..5d6418d 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -354,7 +354,9 @@ namespace WTelegram { _dcSession.DataCenter = _session.DcOptions.Where(dc => dc.id == TLConfig.this_dc) .OrderByDescending(dc => dc.ip_address == endpoint?.Address.ToString()) - .ThenByDescending(dc => dc.port == endpoint?.Port).First(); + .ThenByDescending(dc => dc.port == endpoint?.Port) + .ThenByDescending(dc => dc.flags == (endpoint?.AddressFamily == AddressFamily.InterNetworkV6 ? DcOption.Flags.ipv6 : 0)) + .First(); _session.DCSessions[TLConfig.this_dc] = _dcSession; } if (_session.MainDC == 0) _session.MainDC = TLConfig.this_dc;