aboutsummaryrefslogtreecommitdiff
path: root/network-handler/client.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'network-handler/client.hpp')
-rw-r--r--network-handler/client.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/network-handler/client.hpp b/network-handler/client.hpp
new file mode 100644
index 0000000..878c5be
--- /dev/null
+++ b/network-handler/client.hpp
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <boost/asio/ip/tcp.hpp>
+
+#include <array>
+
+class Client {
+public:
+ typedef std::function<void(void)> OnDoneFT;
+
+private:
+ boost::asio::ip::tcp::socket socket;
+ std::array<uint8_t, 20> buffer;
+ OnDoneFT on_done;
+
+
+public:
+ Client(boost::asio::ip::tcp::socket&& socket);
+
+ void handle_receive(boost::system::error_code const& ec, size_t read_bytes);
+ void receive();
+ void set_on_done(OnDoneFT f);
+};