changed some stuff with directories
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <experimental/filesystem>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
@@ -36,6 +37,8 @@ using namespace Poco::Util;
|
||||
using namespace Poco::JSON;
|
||||
using namespace Poco;
|
||||
|
||||
namespace fs = std::experimental::filesystem;
|
||||
|
||||
FlippRServer::FlippRServer() :
|
||||
help_requested(false),
|
||||
input_port(9980),
|
||||
@@ -189,17 +192,28 @@ HTTPServer* FlippRServer::build_output_server()
|
||||
TCPServer* FlippRServer::build_input_server()
|
||||
{
|
||||
unsigned short port = (unsigned short) config().getInt("FlippRServer.port", this->output_port);
|
||||
|
||||
SocketAddress address(path);
|
||||
|
||||
std::string runtime_dir = this->get_runtime_dir();
|
||||
|
||||
|
||||
SocketAddress address(runtime_dir + SOCKET_NAME);
|
||||
logger().information("Input-Server address is set to: " + address.toString());
|
||||
ServerSocket server_socket(address);
|
||||
|
||||
return new TCPServer(new input::InputSocketHandlerFactory(this->input_driver), port);
|
||||
}
|
||||
|
||||
std::string FlippRServer::create_directory(std::string file_name)
|
||||
{
|
||||
std::string runtime_dir = this->get_runtime_dir();
|
||||
|
||||
fs::path path = runtime_dir + file_name;
|
||||
if(!fs::exists(path))
|
||||
{
|
||||
fs::create_directory(path);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
void FlippRServer::defineOptions(OptionSet& options)
|
||||
{
|
||||
ServerApplication::defineOptions(options);
|
||||
|
||||
Reference in New Issue
Block a user