Updated hue hub version to be 999999999 to help alleviate version

issues. Updated upnp multicast to use one socket. Updated http Handler
code to check for null on conn.
This commit is contained in:
Admin
2017-10-20 11:04:05 -05:00
parent b147f6606e
commit 548da932ad
4 changed files with 38 additions and 23 deletions

View File

@@ -2,6 +2,8 @@ package com.bwssystems.HABridge;
import static spark.Spark.*;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -82,8 +84,14 @@ public class HABridge {
awaitInitialization();
// start the upnp ssdp discovery listener
theUpnpListener = new UpnpListener(bridgeSettings.getBridgeSettingsDescriptor(), bridgeSettings.getBridgeControl(), udpSender);
if(theUpnpListener.startListening())
theUpnpListener = null;
try {
theUpnpListener = new UpnpListener(bridgeSettings.getBridgeSettingsDescriptor(), bridgeSettings.getBridgeControl(), udpSender);
} catch (IOException e) {
log.error("Could not initialize UpnpListener, exiting....", e);
theUpnpListener = null;
}
if(theUpnpListener != null && theUpnpListener.startListening())
log.info("HA Bridge (v" + theVersion.getVersion() + ") reinitialization requessted....");
else
bridgeSettings.getBridgeControl().setStop(true);