summaryrefslogtreecommitdiff
path: root/server/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main.cpp')
-rw-r--r--server/src/main.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/server/src/main.cpp b/server/src/main.cpp
index 13b291b..7274da0 100644
--- a/server/src/main.cpp
+++ b/server/src/main.cpp
@@ -19,11 +19,13 @@
*/
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
+#include <boost/asio.hpp>
#include <iostream>
#include "api_module_metadata_storage.h"
#include "modules_handler.h"
#include "utilities.h"
+#include "server.h"
#include "main.h"
@@ -37,6 +39,9 @@ namespace bpo = boost::program_options;
runtime_config_s runtime_config;
+
+server *serv = nullptr;
+
//TODO: "core" config section architecture, define base settings
@@ -155,6 +160,26 @@ int main(int argc, char *argv[])
{
//TODO: fork here
}
+ boost::asio::io_service io_service_server;
+ try{
+ serv = new server(io_service_server, 6613);
+ }
+ catch(std::exception &e)
+ {
+ //TODO:
+ }
+ catch(...)
+ {
+ //TODO:
+ }
+ boost::system::error_code ec;
+ io_service_server.run(ec);
+ if(ec)
+ {
+ //TODO:
+ }
+
+
//TODO: run here
return 0; //stub for now
}