aboutsummaryrefslogtreecommitdiff
path: root/client/cmixclient.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-12 14:26:12 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-12 14:26:12 +0200
commit7bca48bc5b5e37a3a8b0b23e57b88d069fa50589 (patch)
tree47cd62512e631a064852015c65bb1965bc72414a /client/cmixclient.hpp
parent0fb433690c0ca5f9561fe9e2e973e2cd61b873ba (diff)
downloadcmix-7bca48bc5b5e37a3a8b0b23e57b88d069fa50589.tar.gz
cmix-7bca48bc5b5e37a3a8b0b23e57b88d069fa50589.tar.bz2
cmix-7bca48bc5b5e37a3a8b0b23e57b88d069fa50589.zip
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.
Diffstat (limited to 'client/cmixclient.hpp')
-rw-r--r--client/cmixclient.hpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/client/cmixclient.hpp b/client/cmixclient.hpp
index 5c6405a..056e2b3 100644
--- a/client/cmixclient.hpp
+++ b/client/cmixclient.hpp
@@ -1,6 +1,6 @@
#pragma once
-#include "node.hpp"
+#include "protobufclient.hpp"
#include "api.h"
#include "logging.hpp"
@@ -21,7 +21,7 @@ class CMixClient {
boost::asio::io_service io_service;
std::vector<NodeDetails> network_details;
- std::vector<Node> network_connections;
+ std::vector<ProtobufClient<SendReceive>> network_connections;
Api api;
KeyPair keypair;
@@ -31,14 +31,13 @@ class CMixClient {
void initialize_connections();
- cmix_proto::CMixMessage parse_cmix_message(std::vector<uint8_t> const& buffer);
-
void handle_key_exchange(int node_id, cmix_proto::KeyExchange const& ke);
- void handle_message(int node_id, std::vector<uint8_t> const& message_buffer);
+ void handle_message(int node_id, cmix_proto::CMixMessage message);
public:
CMixClient(std::vector<NodeDetails> details);
+ ~CMixClient();
void run();
}; \ No newline at end of file