Deleting socket files now
This commit is contained in:
@@ -98,6 +98,14 @@ void FlippRServer::uninitialize()
|
||||
this->output_server->stop();
|
||||
|
||||
ServerApplication::uninitialize();
|
||||
|
||||
Poco::File socket_file(this->output_socket_file_path);
|
||||
if (socket_file.exists())
|
||||
socket_file.remove();
|
||||
|
||||
Poco::File input_socket_file(this->input_socket_file_path);
|
||||
if (input_socket_file.exists())
|
||||
input_socket_file.remove();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +179,7 @@ int FlippRServer::main(const std::vector<std::string>& args)
|
||||
{
|
||||
if(!help_requested)
|
||||
{
|
||||
logger().information("Server running!");
|
||||
logger().information(FGRN("Server running!"));
|
||||
waitForTerminationRequest();
|
||||
}
|
||||
return Application::EXIT_OK;
|
||||
@@ -182,7 +190,8 @@ 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);
|
||||
this->output_socket_file_path = this->get_runtime_dir() + OUTPUT_SOCKET_NAME;
|
||||
Poco::File socket_file(output_socket_file_path);
|
||||
if (socket_file.exists())
|
||||
socket_file.remove();
|
||||
|
||||
@@ -196,11 +205,12 @@ 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);
|
||||
this->input_socket_file_path = this->get_runtime_dir() + INPUT_SOCKET_NAME;
|
||||
Poco::File socket_file(input_socket_file_path);
|
||||
if (socket_file.exists())
|
||||
{
|
||||
socket_file.remove();
|
||||
logger().information("Seems that server is already running. Make sure that only one instance of server is running.");
|
||||
logger().information(FRED("Seems that server is already running. Make sure that only one instance of server is running."));
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +263,7 @@ void FlippRServer::handle_config_file(const std::string &name, const std::string
|
||||
logger().information("Configuration \"" + name + "\" is not known.");
|
||||
return;
|
||||
}
|
||||
logger().information("Set " + name + " to " + value);
|
||||
logger().information(KMAG "Set " + name + " to " + value + RST);
|
||||
}
|
||||
|
||||
void FlippRServer::handle_help(const std::string& name, const std::string& value)
|
||||
|
||||
Reference in New Issue
Block a user