aboutsummaryrefslogtreecommitdiff
path: root/node/node.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-05 12:56:52 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-05 14:12:28 +0200
commit88c5130eccd06e63ffca732626c0fb59426743a7 (patch)
treef9c7c4536bfa50057269c3636baedea3cb859ac1 /node/node.hpp
parentedc3690d62890449df3ae4c14636019bce4833f1 (diff)
downloadcmix-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/node.hpp')
-rw-r--r--node/node.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/node/node.hpp b/node/node.hpp
index a481c70..a4e21b3 100644
--- a/node/node.hpp
+++ b/node/node.hpp
@@ -2,6 +2,7 @@
#include "server.hpp"
#include "nodeclient.hpp"
+#include "prevnode.hpp"
#include "nextnode.hpp"
#include "api.h"
@@ -33,10 +34,12 @@ class Node
{
boost::asio::io_service io_service;
Server server;
+ std::list<Client> purgatory;
std::list<Client> clients;
NodeNetworkSettings network_settings;
+ PrevNode prev_node;
NextNode next_node;
Api api;
@@ -48,8 +51,13 @@ class Node
void start_precomputation();
void start_initialisation();
- void handle_message(std::vector<uint8_t> const& message_buffer);
void handle_initialization(cmix_proto::Initialization const& init);
+ void handle_message(std::vector<uint8_t> const& message_buffer);
+
+ void handle_imanode(std::list<Client>::iterator handle);
+ void handle_imaclient(std::list<Client>::iterator handle);
+ void handle_message(std::list<Client>::iterator handle, std::vector<uint8_t> const& message_buffer);
+
public:
/*!