many changes

This commit is contained in:
Jonas Zeunert
2019-05-22 00:00:16 +02:00
parent c32ce18841
commit d6cead914f
8 changed files with 90 additions and 5 deletions

View File

@@ -0,0 +1,51 @@
//
// Created by rhetenor on 5/21/19.
//
#include "FlippRServer.h"
#include "output/OutputRequestHandlerFactory.h"
#include <DriverFactory.h>
#include <output/OutputDriver.h>
#include <input/InputDriver.h>
#include <Poco/Net/SocketAddress.h>
#include <Poco/Net/ServerSocket.h>
#include <Poco/Net/HTTPServer.h>
int main(int argc, char** argv)
{
flippR_driver::networking::FlippRServer app;
return app.run(argc, argv);
}
namespace flippR_driver
{
namespace networking
{
using namespace Poco::Net;
int FlippRServer::main(const std::vector<std::string>& args)
{
if (!_helpRequested)
{
unsigned short port = (unsigned short)
config().getInt("HTTPTimeServer.port", 9980);
// todo XDG_RUNTIME_DIR
SocketAddress address("/tmp/flippR_driver/S.flippR_driver");
ServerSocket svs(address);
HTTPServer srv(new OutputRequestHandlerFactory(),
svs, new HTTPServerParams);
srv.start();
waitForTerminationRequest();
srv.stop();
}
return Application::EXIT_OK;
}
}
}