From 37effc3e136c73afd4d6ba37d23a91766795d0f7 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Thu, 29 Sep 2016 17:23:22 +0200 Subject: This changset triggered a storm of changes. Added the behaviour for receiving a public_share message from our previous node when not being the first node ourselves. This triggered the whitespace bug below, which sparked the network rewrite. Rewrote network protocol to first send the size of the message it's sending in a 32bit integer in network byte order. Fixed a bug where whitespace in the received buffer would be skipped. leading to broken protobuf messages. NextNode no longers inherits from client but owns one, and some functions needed to be forwarded. --- node/nextnode.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'node/nextnode.hpp') diff --git a/node/nextnode.hpp b/node/nextnode.hpp index 24b93c4..6550445 100644 --- a/node/nextnode.hpp +++ b/node/nextnode.hpp @@ -11,8 +11,9 @@ /*! * \brief The NextNode class represents the next node in the network, will only be sent to. */ -class NextNode : public Client +class NextNode { + Client client; public: /*! * \brief NextNode @@ -27,12 +28,12 @@ public: void send(std::string message); /*! - * \brief connect + * \brief async_connect * \param next_host The host of the next node. * \param next_port The port of the next node. * \param on_connect The callback to call when the connect was succesfull. */ - void connect(std::string next_host, std::string next_port, std::function on_connect); + void async_connect(std::string next_host, std::string next_port, std::function on_connect); /*! * \brief close This function closes the underlying socket connection. -- cgit v1.2.3-70-g09d2