added server config file
This commit is contained in:
@@ -58,8 +58,7 @@ void FlippRServer::parse_server_config_file()
|
||||
|
||||
try
|
||||
{
|
||||
config.open("server_config.json");
|
||||
json = parser.parse(config).extract<Object::Ptr>();
|
||||
config.open("./server_config.json");
|
||||
}
|
||||
catch(const std::exception e)
|
||||
{
|
||||
@@ -67,6 +66,16 @@ void FlippRServer::parse_server_config_file()
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
json = parser.parse(config).extract<Object::Ptr>();
|
||||
}
|
||||
catch(const std::exception e)
|
||||
{
|
||||
logger().information(FRED("server_config.json not readable!"));
|
||||
return;
|
||||
}
|
||||
|
||||
logger().information(FCYN("Parsing server_config.json..."));
|
||||
|
||||
for(auto &config_json : json->getNames())
|
||||
@@ -164,7 +173,7 @@ HTTPServer* FlippRServer::build_output_server()
|
||||
unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", this->output_port);
|
||||
|
||||
// todo XDG_RUNTIME_DIR
|
||||
SocketAddress address("/tmp/flippR_driver/S.flippR_driver");
|
||||
SocketAddress address;
|
||||
ServerSocket server_socket(address);
|
||||
|
||||
return new HTTPServer(new OutputRequestHandlerFactory(this->output_driver), server_socket, new HTTPServerParams);
|
||||
@@ -175,7 +184,7 @@ TCPServer* FlippRServer::build_input_server()
|
||||
unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", this->output_port);
|
||||
|
||||
//TODO adapt path
|
||||
SocketAddress address("/tmp/flippR_driver/S.flippR_driver");
|
||||
SocketAddress address;
|
||||
ServerSocket server_socket(address);
|
||||
|
||||
return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), port);
|
||||
|
||||
Reference in New Issue
Block a user