Fix fast polling

This commit is contained in:
Cameron Gutman 2015-02-22 18:34:28 -05:00
parent 0b7becb161
commit e222f2f6c3

View File

@ -118,7 +118,7 @@ public class ComputerManagerService extends Service {
while (!isInterrupted() && pollingActive) { while (!isInterrupted() && pollingActive) {
try { try {
// Check if this poll has modified the details // Check if this poll has modified the details
pollComputer(details); runPoll(details, false);
// Wait until the next polling interval // Wait until the next polling interval
Thread.sleep(POLLING_PERIOD_MS); Thread.sleep(POLLING_PERIOD_MS);
@ -293,7 +293,7 @@ public class ComputerManagerService extends Service {
// Block while we try to fill the details // Block while we try to fill the details
try { try {
pollComputer(fakeDetails); runPoll(fakeDetails, true);
} catch (InterruptedException e) { } catch (InterruptedException e) {
return false; return false;
} }
@ -441,10 +441,10 @@ public class ComputerManagerService extends Service {
// If the local address is routable across the Internet, // If the local address is routable across the Internet,
// always consider this PC remote to be conservative // always consider this PC remote to be conservative
/*if (details.localIp.equals(details.remoteIp)) { if (details.localIp.equals(details.remoteIp)) {
reachability = ComputerDetails.Reachability.REMOTE; reachability = ComputerDetails.Reachability.REMOTE;
} }
else*/ { else {
// Do a TCP-level connection to the HTTP server to see if it's listening // Do a TCP-level connection to the HTTP server to see if it's listening
LimeLog.info("Starting fast poll for "+details.name+" ("+details.localIp+", "+details.remoteIp+")"); LimeLog.info("Starting fast poll for "+details.name+" ("+details.localIp+", "+details.remoteIp+")");
reachability = fastPollPc(details.localIp, details.remoteIp); reachability = fastPollPc(details.localIp, details.remoteIp);