52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
//
|
|
// 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;
|
|
}
|
|
}
|
|
}
|
|
|