This commit is contained in:
emeric
2014-04-07 22:53:26 +02:00
parent 02959ee66f
commit c6a24d7b46
3 changed files with 21 additions and 9 deletions
+3 -3
View File
@@ -9,7 +9,7 @@ RemoteServerService::RemoteServerService(const Remote::Server::Server::endpoint_
void void
RemoteServerService::start(void) RemoteServerService::start(void)
{ {
std::cout << "émoteServerService::start, starting..." << std::endl; std::cout << "RemoteServerService::start, starting..." << std::endl;
_server.run(); _server.run();
} }
@@ -17,12 +17,12 @@ RemoteServerService::start(void)
void void
RemoteServerService::stop(void) RemoteServerService::stop(void)
{ {
std::cout << "émoteServerService::stop, stopping..." << std::endl; std::cout << "RemoteServerService::stop, stopping..." << std::endl;
_server.stop(); _server.stop();
} }
void void
RemoteServerService::restart(void) RemoteServerService::restart(void)
{ {
std::cout << "émoteServerService::restart, not implemented!" << std::endl; std::cout << "RemoteServerService::restart, not implemented!" << std::endl;
} }
+14 -4
View File
@@ -1,3 +1,5 @@
#include <iostream>
#include <iomanip>
#include "WebServerService.hpp" #include "WebServerService.hpp"
#include "ui/LmsApplication.hpp" #include "ui/LmsApplication.hpp"
@@ -9,14 +11,16 @@ Wt::WApplication *createApplication(const Wt::WEnvironment& env)
* You could read information from the environment to decide whether * You could read information from the environment to decide whether
* the user has permission to start a new application * the user has permission to start a new application
*/ */
std::cout << "Creating new Application" << std::endl;
return new LmsApplication(env); return new LmsApplication(env);
} }
WebServerService::WebServerService( int argc, char* argv[]) WebServerService::WebServerService( int argc, char* argv[])
: _server(argv[0]) : _server(argv[0], "")
{ {
std::cout << "Constructing server... argc = " << argc << std::endl;
// TODO configure server // TODO configure server
_server.setServerConfiguration (argc, argv, WTHTTP_CONFIGURATION); _server.setServerConfiguration (argc, argv, WTHTTP_CONFIGURATION);
@@ -24,18 +28,24 @@ WebServerService::WebServerService( int argc, char* argv[])
_server.addEntryPoint(Wt::Application, createApplication); _server.addEntryPoint(Wt::Application, createApplication);
std::cout << "WebServerService done!" << std::endl;
} }
void void
WebServerService::start(void) WebServerService::start(void)
{ {
_server.start(); std::cout << "Starting service..." << std::endl;
bool res = _server.start();
std::cout << "_server.start returned " << std::boolalpha << res << std::endl;
std::cout << "Service started..." << std::endl;
} }
void void
WebServerService::stop(void) WebServerService::stop(void)
{ {
_server.stop(); _server.stop();
} }
void void
+4 -2
View File
@@ -9,6 +9,8 @@
#include "WebServerService.hpp" #include "WebServerService.hpp"
#include "RemoteServerService.hpp" #include "RemoteServerService.hpp"
void toto(int argc, char* argv[]);
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@@ -22,9 +24,9 @@ int main(int argc, char* argv[])
Av::AvInit(); Av::AvInit();
Transcode::AvConvTranscoder::init(); Transcode::AvConvTranscoder::init();
serviceManager.startService( std::make_shared<DatabaseRefreshService>( "test.db" ) ); // 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.startService( std::make_shared<RemoteServerService>( Remote::Server::Server::endpoint_type() ) );
serviceManager.run(); serviceManager.run();