mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user