mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
People are reporting that under some circumstances, an infinite loop could happen when TLSharp tries to handle a reconnection to a different DC, if the DC instructed to be used is the same as the one that was used in the last connection. Not sure how could this happen (although the analysis present in this github issue [1] might help understand it), but this commit helps to make TLSharp fail fast (with an exception) instead of an infinite loop from now on, which will help avoiding people file issues such as [2] and [3] and instead maybe file a proper bug report easier to understand, to try to fix the underlying root cause. [1] https://github.com/sochix/TLSharp/issues/719 [2] https://github.com/sochix/TLSharp/issues/803 [3] https://github.com/sochix/TLSharp/issues/839
22 lines
510 B
C#
22 lines
510 B
C#
|
|
namespace TLSharp.Core
|
|
{
|
|
internal class DataCenter
|
|
{
|
|
internal DataCenter (int? dcId, string address, int port)
|
|
{
|
|
DataCenterId = dcId;
|
|
Address = address;
|
|
Port = port;
|
|
}
|
|
|
|
internal DataCenter (string address, int port) : this (null, address, port)
|
|
{
|
|
}
|
|
|
|
internal int? DataCenterId { get; private set; }
|
|
internal string Address { get; private set; }
|
|
internal int Port { get; private set; }
|
|
}
|
|
}
|