From 7bca48bc5b5e37a3a8b0b23e57b88d069fa50589 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 12 Oct 2016 14:26:12 +0200 Subject: Major network rewrite. One generic class has been introduced to handle all connection types. Typedefs provide Sender Receiver and SenderReceiver types, which limit the functionality of the types. As to not accidentally communicate with the wrong node about things. --- node/node.hpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'node/node.hpp') diff --git a/node/node.hpp b/node/node.hpp index 44e379f..9f1f3a2 100644 --- a/node/node.hpp +++ b/node/node.hpp @@ -1,9 +1,7 @@ #pragma once #include "server.hpp" -#include "nodeclient.hpp" -#include "prevnode.hpp" -#include "nextnode.hpp" +#include "protobufclient.hpp" #include "api.h" @@ -33,13 +31,13 @@ class Node { boost::asio::io_service io_service; Server server; - std::list purgatory; - std::list clients; + std::list purgatory; + std::list clients; NodeNetworkSettings network_settings; - PrevNode prev_node; - NextNode next_node; + Receiver prev_node; + Sender next_node; Api api; KeyPair keypair; @@ -50,16 +48,14 @@ class Node void start_precomputation(); void start_initialisation(); - cmix_proto::CMixMessage parse_cmix_message(std::vector const& buffer); - void handle_initialization(cmix_proto::Initialization const& init); - void handle_node_message(std::vector const& message_buffer); + void handle_node_message(cmix_proto::CMixMessage message); - void handle_client_message(std::list::iterator handle, std::vector const& message_buffer); + void handle_client_message(std::list::iterator handle, cmix_proto::CMixMessage message); - void handle_imanode(std::list::iterator handle); - void handle_imaclient(std::list::iterator handle); - void handle_message(std::list::iterator handle, std::vector const& message_buffer); + void handle_imanode(std::list::iterator handle); + void handle_imaclient(std::list::iterator handle); + void handle_message(std::list>::iterator handle, cmix_proto::CMixMessage message); public: -- cgit v1.2.3-70-g09d2