Commit ff85d74b authored by DrKLO's avatar DrKLO

Fixed datacenter port switch condition

parent 507d05aa
...@@ -423,7 +423,7 @@ public class TcpConnection extends PyroClientAdapter { ...@@ -423,7 +423,7 @@ public class TcpConnection extends PyroClientAdapter {
} else { } else {
FileLog.d("tmessages", "Disconnected " + TcpConnection.this); FileLog.d("tmessages", "Disconnected " + TcpConnection.this);
} }
boolean swirchToNextPort = wasConnected && hasSomeDataSinceLastConnect; boolean switchToNextPort = wasConnected && !hasSomeDataSinceLastConnect && timedout;
firstPacket = true; firstPacket = true;
restOfTheData = null; restOfTheData = null;
channelToken = 0; channelToken = 0;
...@@ -452,7 +452,7 @@ public class TcpConnection extends PyroClientAdapter { ...@@ -452,7 +452,7 @@ public class TcpConnection extends PyroClientAdapter {
} }
if (ConnectionsManager.isNetworkOnline()) { if (ConnectionsManager.isNetworkOnline()) {
isNextPort = true; isNextPort = true;
if (failedConnectionCount > willRetryConnectCount || swirchToNextPort) { if (failedConnectionCount > willRetryConnectCount || switchToNextPort) {
Datacenter datacenter = ConnectionsManager.Instance.datacenterWithId(datacenterId); Datacenter datacenter = ConnectionsManager.Instance.datacenterWithId(datacenterId);
datacenter.nextAddressOrPort(); datacenter.nextAddressOrPort();
failedConnectionCount = 0; failedConnectionCount = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment