From 2f1c3293d2c5776c4ecd9b2f1dce66492b15dbdd Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 31 Aug 2016 11:57:15 +0200 Subject: Split up the client and server parts in a separate network library --- libcmix-network/server.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libcmix-network/server.hpp (limited to 'libcmix-network/server.hpp') diff --git a/libcmix-network/server.hpp b/libcmix-network/server.hpp new file mode 100644 index 0000000..942cb14 --- /dev/null +++ b/libcmix-network/server.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include + +#include "acceptor.hpp" + +struct ListenSettings { + bool enable_ipv4; + std::string ipv4_inaddr; + bool enable_ipv6; + std::string ipv6_inaddr; + uint16_t port; +}; + +class Server +{ +public: + typedef std::function AcceptHandler; + +private: + ListenSettings const& listen_settings; + + Acceptor v4_acceptor; + Acceptor v6_acceptor; + +public: + Server(boost::asio::io_service& io_service, ListenSettings const& listen_settings, AcceptHandler accept_handler); + +}; -- cgit v1.2.3-70-g09d2