merged
This commit is contained in:
@@ -173,7 +173,9 @@ HTTPServer* FlippRServer::build_output_server()
|
||||
unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", this->output_port);
|
||||
|
||||
// todo XDG_RUNTIME_DIR
|
||||
SocketAddress address;
|
||||
std::string runtime_dir = this->get_runtime_dir();
|
||||
|
||||
SocketAddress address(runtime_dir + SOCKET_NAME);
|
||||
ServerSocket server_socket(address);
|
||||
|
||||
return new HTTPServer(new OutputRequestHandlerFactory(this->output_driver), server_socket, new HTTPServerParams);
|
||||
@@ -184,7 +186,8 @@ TCPServer* FlippRServer::build_input_server()
|
||||
unsigned short port = (unsigned short) config().getInt("HTTPTimeServer.port", this->output_port);
|
||||
|
||||
//TODO adapt path
|
||||
SocketAddress address;
|
||||
std::string runtime_dir = this->get_runtime_dir();
|
||||
SocketAddress address(runtime_dir + SOCKET_NAME);
|
||||
ServerSocket server_socket(address);
|
||||
|
||||
return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), port);
|
||||
@@ -299,6 +302,14 @@ void FlippRServer::handle_help(const std::string& name, const std::string& value
|
||||
stopOptionsProcessing();
|
||||
help_requested = true;
|
||||
}
|
||||
std::string FlippRServer::get_runtime_dir()
|
||||
{
|
||||
std::string runtime_dir = std::getenv("XDG_RUNTIME_DIR");
|
||||
if(runtime_dir == "")
|
||||
{
|
||||
runtime_dir = DEFAULT_RUNTIME_DIR;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user