If we've previously been able to reach a machine via a local or remote IP, always try that one first when polling on subsequent tries

This commit is contained in:
Cameron Gutman 2014-11-16 14:35:36 -08:00
parent dd59f0bc6d
commit cd49334199

View File

@ -347,8 +347,19 @@ public class ComputerManagerService extends Service {
}
private boolean doPollMachine(ComputerDetails details) {
if (details.reachability == ComputerDetails.Reachability.UNKNOWN ||
details.reachability == ComputerDetails.Reachability.OFFLINE) {
// Always try local first to avoid potential UDP issues when
// attempting to stream via the router's external IP address
// behind its NAT
return pollComputer(details, true);
}
else {
// If we're already reached a machine via a particular IP address,
// always try that one first
return pollComputer(details, details.reachability == ComputerDetails.Reachability.LOCAL);
}
}
@Override
public void onCreate() {