Commit another batch of fine-tuning for the bridge/server. Still not getting the server->bridge connection for some reason - working on it...

This commit is contained in:
Ken Moore
2016-05-18 14:44:42 -04:00
parent 18bcd3b03e
commit 6e07eb7c49
5 changed files with 10 additions and 1 deletions

View File

@@ -219,7 +219,9 @@ void WebServer::SocketClosed(QString ID){
// BRIDGE Connection checks
void WebServer::checkBridges(){
qDebug() << "Check Bridges:" << WS_MODE;
if(!WS_MODE){ return; }
//Get all the unique bridge URL's we need connections to
QStringList bridgeKeys = CONFIG->allKeys().filter("bridge_connections/");
for(int i=0; i<bridgeKeys.length(); i++){
@@ -236,6 +238,7 @@ void WebServer::checkBridges(){
}
//Now startup any connections which are missing
for(int i=0; i<bridgeKeys.length(); i++){
qDebug() << "Try to connect to bridge:" << bridgeKeys[i];
WebSocket *sock = new WebSocket(bridgeKeys[i], bridgeKeys[i], AUTH);
connect(sock, SIGNAL(SocketClosed(QString)), this, SLOT(SocketClosed(QString)) );
OpenSockets << sock;