aboutsummaryrefslogtreecommitdiff
path: root/node/nextnode.hpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-09-29 17:23:22 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-09-29 17:23:22 +0200
commit37effc3e136c73afd4d6ba37d23a91766795d0f7 (patch)
treee5a1684231df52f48088dd053d57132d390e5a02 /node/nextnode.hpp
parentf7f0e8c53bc8231264346ef91e2f533164a25562 (diff)
downloadcmix-37effc3e136c73afd4d6ba37d23a91766795d0f7.tar.gz
cmix-37effc3e136c73afd4d6ba37d23a91766795d0f7.tar.bz2
cmix-37effc3e136c73afd4d6ba37d23a91766795d0f7.zip
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.
Diffstat (limited to 'node/nextnode.hpp')
-rw-r--r--node/nextnode.hpp7
1 files changed, 4 insertions, 3 deletions
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<void()> on_connect);
+ void async_connect(std::string next_host, std::string next_port, std::function<void()> on_connect);
/*!
* \brief close This function closes the underlying socket connection.