forward protobuf messages.

configure (send proto messages to two other hyperiond):

"protoServer" :
{
	"port"    : 19446,
	"forward" : [ "192.168.0.10:19445", "192.168.0.11:19445" ]
},


Former-commit-id: 33af219cfce99609ca7245d662dc0f0561013bbd
This commit is contained in:
redpanther
2016-02-08 16:56:23 +01:00
parent cf34f45daa
commit 5dc59344c4
6 changed files with 48 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
// C++ includes
#include <cassert>
#include <csignal>
#include <vector>
// QT includes
#include <QCoreApplication>
@@ -368,7 +369,18 @@ int main(int argc, char** argv)
if (config.isMember("protoServer"))
{
const Json::Value & protoServerConfig = config["protoServer"];
protoServer = new ProtoServer(&hyperion, protoServerConfig["port"].asUInt());
QStringList forwardClientList;
if ( ! protoServerConfig["forward"].isNull() && protoServerConfig["forward"].isArray() )
{
for (const Json::Value& client : protoServerConfig["forward"])
{
forwardClientList << client.asString().c_str();
std::cout << client.asString() << std::endl;
}
}
protoServer = new ProtoServer(&hyperion, protoServerConfig["port"].asUInt(), &forwardClientList );
std::cout << "Proto server created and started on port " << protoServer->getPort() << std::endl;
}
#endif