summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..a7a1c34
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,28 @@
+#include "server.h"
+
+#include <boost/asio.hpp>
+#include <boost/thread.hpp>
+
+#ifdef WIN32
+/* hachish fix for mingw builds */
+namespace boost {
+ void tss_cleanup_implemented() { }
+}
+#endif
+
+int main(int argc, char **argv) {
+ boost::asio::io_service io_service;
+ Server server(io_service);
+
+ std::size_t num_threads = 1;
+ std::vector<boost::shared_ptr<boost::thread> > threads;
+ for(std::size_t i = 0; i < num_threads; i++) {
+ boost::shared_ptr<boost::thread> thread(new boost::thread(boost::bind(&boost::asio::io_service::run, &io_service)));
+ threads.push_back(thread);
+ }
+ for(std::size_t i = 0; i < num_threads; i++) {
+ threads[i]->join();
+ }
+
+ return 0;
+}