diff --git a/FlippR-Driver/networking/FlippRServer.cpp b/FlippR-Driver/networking/FlippRServer.cpp index a2f9acd..4b99e6f 100644 --- a/FlippR-Driver/networking/FlippRServer.cpp +++ b/FlippR-Driver/networking/FlippRServer.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -182,9 +181,9 @@ HTTPServer* FlippRServer::build_output_server() { unsigned short port = (unsigned short) config().getInt("FlippRServer.port", this->output_port); - Poco::File socket_file(this->get_runtime_dir() + OUTPUT_SOCKET_NAME); + output_socket_file = Poco::File(this->get_runtime_dir() + OUTPUT_SOCKET_NAME); - SocketAddress address(SocketAddress::UNIX_LOCAL, socket_file.path()); + SocketAddress address(SocketAddress::UNIX_LOCAL, output_socket_file.path()); ServerSocket server_socket(address); return new HTTPServer(new OutputRequestHandlerFactory(this->output_driver), server_socket, new HTTPServerParams); @@ -194,9 +193,9 @@ TCPServer* FlippRServer::build_input_server() { unsigned short port = (unsigned short) config().getInt("FlippRServer.port", this->input_port); - Poco::File socket_file(this->get_runtime_dir() + INPUT_SOCKET_NAME); + input_socket_file = Poco::File(this->get_runtime_dir() + INPUT_SOCKET_NAME); - SocketAddress address(SocketAddress::UNIX_LOCAL, socket_file.path()); + SocketAddress address(SocketAddress::UNIX_LOCAL, input_socket_file.path()); ServerSocket server_socket(address); return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), server_socket); @@ -262,7 +261,8 @@ void FlippRServer::handle_help(const std::string& name, const std::string& value std::string FlippRServer::get_runtime_dir() { - return std::getenv("XDG_RUNTIME_DIR") ? std::getenv("XDG_RUNTIME_DIR") : DEFAULT_RUNTIME_DIR; + return DEFAULT_RUNTIME_DIR; + //return std::getenv("XDG_RUNTIME_DIR") ? std::getenv("XDG_RUNTIME_DIR") : DEFAULT_RUNTIME_DIR; } } diff --git a/FlippR-Driver/networking/FlippRServer.h b/FlippR-Driver/networking/FlippRServer.h index ca5e327..f8becdb 100644 --- a/FlippR-Driver/networking/FlippRServer.h +++ b/FlippR-Driver/networking/FlippRServer.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace flippR_driver { @@ -62,6 +63,8 @@ private: std::unique_ptr output_server; std::unique_ptr input_server; + Poco::File output_socket_file, input_socket_file; + }; };