many changes
This commit is contained in:
51
FlippR-Driver/networking/FlippRServer.cpp
Normal file
51
FlippR-Driver/networking/FlippRServer.cpp
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user