WIP, compile problems
This commit is contained in:
@@ -7,15 +7,15 @@
|
||||
#include "ServiceManager.hpp"
|
||||
|
||||
ServiceManager::ServiceManager()
|
||||
: _signalSet(_ioService)
|
||||
/*: _signalSet(_ioService) */
|
||||
{
|
||||
_signalSet.add(SIGINT);
|
||||
/* _signalSet.add(SIGINT);
|
||||
_signalSet.add(SIGTERM);
|
||||
#if defined(SIGQUIT)
|
||||
_signalSet.add(SIGQUIT);
|
||||
#endif // defined(SIGQUIT)
|
||||
|
||||
_signalSet.add(SIGHUP);
|
||||
_signalSet.add(SIGHUP);*/
|
||||
}
|
||||
|
||||
void
|
||||
@@ -32,10 +32,10 @@ ServiceManager::run()
|
||||
void
|
||||
ServiceManager::asyncWaitSignals(void)
|
||||
{
|
||||
_signalSet.async_wait(boost::bind(&ServiceManager::handleSignal,
|
||||
/* _signalSet.async_wait(boost::bind(&ServiceManager::handleSignal,
|
||||
this,
|
||||
boost::asio::placeholders::error,
|
||||
boost::asio::placeholders::signal_number));
|
||||
boost::asio::placeholders::signal_number));*/
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -31,7 +31,7 @@ class ServiceManager
|
||||
boost::asio::io_service _ioService;
|
||||
|
||||
// Listen for interesting signals
|
||||
boost::asio::signal_set _signalSet;
|
||||
// boost::asio::signal_set _signalSet;
|
||||
|
||||
std::set<Service::pointer> _services;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "ui/LmsApplication.hpp"
|
||||
|
||||
|
||||
Wt::WApplication *createApplication(const Wt::WEnvironment& env)
|
||||
static Wt::WApplication *createApplication(const Wt::WEnvironment& env)
|
||||
{
|
||||
/*
|
||||
* You could read information from the environment to decide whether
|
||||
@@ -19,7 +19,7 @@ WebServerService::WebServerService( int argc, char* argv[])
|
||||
: _server(argv[0], "")
|
||||
{
|
||||
|
||||
std::cout << "Constructing server... argc = " << argc << std::endl;
|
||||
std::cout << "Constructing server... argv[0] = '" << argv[0] << "' argc = " << argc << std::endl;
|
||||
|
||||
// TODO configure server
|
||||
_server.setServerConfiguration (argc, argv, WTHTTP_CONFIGURATION);
|
||||
|
||||
+29
-4
@@ -9,7 +9,17 @@
|
||||
#include "WebServerService.hpp"
|
||||
#include "RemoteServerService.hpp"
|
||||
|
||||
void toto(int argc, char* argv[]);
|
||||
#include "ui/LmsApplication.hpp"
|
||||
|
||||
static Wt::WApplication *createApplication(const Wt::WEnvironment& env)
|
||||
{
|
||||
/*
|
||||
* You could read information from the environment to decide whether
|
||||
* the user has permission to start a new application
|
||||
*/
|
||||
std::cout << "Creating new Application" << std::endl;
|
||||
return new LmsApplication(env);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
@@ -18,17 +28,32 @@ int main(int argc, char* argv[])
|
||||
|
||||
try
|
||||
{
|
||||
ServiceManager serviceManager;
|
||||
// ServiceManager serviceManager;
|
||||
|
||||
// lib init
|
||||
Av::AvInit();
|
||||
Transcode::AvConvTranscoder::init();
|
||||
|
||||
return Wt::WRun(argc, argv, createApplication);
|
||||
/* Wt::WServer server(argv[0], "");
|
||||
|
||||
server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
|
||||
server.addEntryPoint(Wt::Application, createApplication);
|
||||
if (server.start()) {
|
||||
int sig = Wt::WServer::waitForShutdown(argv[0]);
|
||||
std::cerr << "Shutdown (signal = " << sig << ")" << std::endl;
|
||||
server.stop();
|
||||
if (sig == SIGHUP)
|
||||
Wt::WServer::restart(argc, argv, environ);
|
||||
}*/
|
||||
// return 0;
|
||||
|
||||
|
||||
// serviceManager.startService( std::make_shared<DatabaseRefreshService>( "test.db" ) );
|
||||
serviceManager.startService( std::make_shared<WebServerService>(argc, argv) );
|
||||
// serviceManager.startService( std::make_shared<WebServerService>(argc, argv) );
|
||||
// serviceManager.startService( std::make_shared<RemoteServerService>( Remote::Server::Server::endpoint_type() ) );
|
||||
|
||||
serviceManager.run();
|
||||
// serviceManager.run();
|
||||
|
||||
res = EXIT_SUCCESS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user