diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-05 12:56:52 +0200 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-10-05 14:12:28 +0200 |
| commit | 88c5130eccd06e63ffca732626c0fb59426743a7 (patch) | |
| tree | f9c7c4536bfa50057269c3636baedea3cb859ac1 /node/prevnode.cpp | |
| parent | edc3690d62890449df3ae4c14636019bce4833f1 (diff) | |
| download | cmix-88c5130eccd06e63ffca732626c0fb59426743a7.tar.gz cmix-88c5130eccd06e63ffca732626c0fb59426743a7.tar.bz2 cmix-88c5130eccd06e63ffca732626c0fb59426743a7.zip | |
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.
Diffstat (limited to 'node/prevnode.cpp')
| -rw-r--r-- | node/prevnode.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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<void (const std::vector<uint8_t>&)> receive_handler) { + client.receive(receive_handler); +} + +void PrevNode::close() +{ + client.close(); +} |
