From 88c5130eccd06e63ffca732626c0fb59426743a7 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 5 Oct 2016 12:56:52 +0200 Subject: Seperates Nodes and Clients for incoming connections. Created a PrevNode class to reflect the seperation. Made Client movable. Added 2 empty protobuf message that declare what each connecting client is, sent when connected to a node. --- node/prevnode.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 node/prevnode.cpp (limited to 'node/prevnode.cpp') diff --git a/node/prevnode.cpp b/node/prevnode.cpp new file mode 100644 index 0000000..6af2242 --- /dev/null +++ b/node/prevnode.cpp @@ -0,0 +1,14 @@ +#include "prevnode.hpp" + +PrevNode::PrevNode(Client&& client) +: client(std::move(client)) +{} + +void PrevNode::receive(std::function&)> receive_handler) { + client.receive(receive_handler); +} + +void PrevNode::close() +{ + client.close(); +} -- cgit v1.2.3-70-g09d2