Fix MDNS PC discovery

This commit is contained in:
Cameron Gutman
2014-09-16 18:44:57 -07:00
parent fa85922840
commit 9fff8e9bd0

View File

@@ -394,9 +394,9 @@ public class Limelight implements NvConnectionListener {
}
public void discover(final boolean first) {
displayMessage("Discover GFE");
displayMessage("Discovering GeForce PCs...");
final Object mutex = new Object();
new MdnsDiscoveryAgent(new MdnsDiscoveryListener() {
MdnsDiscoveryAgent agent = new MdnsDiscoveryAgent(new MdnsDiscoveryListener() {
@Override
public void notifyComputerAdded(MdnsComputer computer) {
displayMessage(" " + computer.getName() + " " + computer.getAddress().getHostAddress());
@@ -415,11 +415,13 @@ public class Limelight implements NvConnectionListener {
public void notifyDiscoveryFailure(Exception e) {
}
});
agent.startDiscovery(1000);
synchronized (mutex) {
try {
mutex.wait();
} catch (InterruptedException ex) { }
}
agent.stopDiscovery();
}
public String getUniqueId() {