aboutsummaryrefslogtreecommitdiff
path: root/network-handler/networkhandler.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'network-handler/networkhandler.hpp')
-rw-r--r--network-handler/networkhandler.hpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/network-handler/networkhandler.hpp b/network-handler/networkhandler.hpp
index 058f6a9..dfa31f1 100644
--- a/network-handler/networkhandler.hpp
+++ b/network-handler/networkhandler.hpp
@@ -1,35 +1,22 @@
#pragma once
-#include "acceptor.hpp"
+#include "server.hpp"
#include "userclient.hpp"
#include <boost/asio/io_service.hpp>
-#include <boost/asio/streambuf.hpp>
-#include <string>
-#include <cstdint>
#include <list>
-struct ListenSettings {
- bool enable_ipv4;
- std::string ipv4_inaddr;
- bool enable_ipv6;
- std::string ipv6_inaddr;
- uint16_t port;
-};
-
class NetworkHandler
{
- ListenSettings const& listen_settings;
-
boost::asio::io_service io_service;
- Acceptor v4_acceptor;
- Acceptor v6_acceptor;
-
+ Server server;
std::list<UserClient> clients;
+ void accept_handler(boost::asio::ip::tcp::socket&& socket);
+
public:
NetworkHandler(ListenSettings const& listen_settings);
-
+
void run();
};