aboutsummaryrefslogtreecommitdiff
path: root/libcmix-network
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-10-11 12:39:05 +0200
committerDennis Brentjes <d.brentjes@gmail.com>2016-10-11 12:39:05 +0200
commit0fb433690c0ca5f9561fe9e2e973e2cd61b873ba (patch)
tree9422a034b09d1e0b46144f35a1f9bcf7860156d6 /libcmix-network
parentd8e48c32f8435076382543edfafbf81c223f9e87 (diff)
downloadcmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.tar.gz
cmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.tar.bz2
cmix-0fb433690c0ca5f9561fe9e2e973e2cd61b873ba.zip
Commit introducing Client keyexchange, triggering bugs.
Clients now send their public key to each node and the node calculates the shared secret. The node does not yet respond with it's public key. To keep this commit smaller. Nodes now disconnect from each other in a better way. Getting the relevant crypto api is now done with a generic function. What crypto algorithm and implemenation is beign used can be selected in the cmake cache (use cmake-gui or ccmake) Clients now connect correctly to multiple nodes.
Diffstat (limited to 'libcmix-network')
-rw-r--r--libcmix-network/client.cpp2
-rw-r--r--libcmix-network/connect.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/libcmix-network/client.cpp b/libcmix-network/client.cpp
index 9293bd1..f693afa 100644
--- a/libcmix-network/client.cpp
+++ b/libcmix-network/client.cpp
@@ -81,7 +81,7 @@ void Client::handle_receive_message(MessageHandler message_handler, const error_
}
}
-void Client::handle_receive_size(Client::MessageHandler message_handler, const error_code& ec, size_t read_bytes)
+void Client::handle_receive_size(Client::MessageHandler message_handler, error_code const& ec, size_t read_bytes)
{
using namespace boost::asio::placeholders;
diff --git a/libcmix-network/connect.cpp b/libcmix-network/connect.cpp
index fb663ac..01e72de 100644
--- a/libcmix-network/connect.cpp
+++ b/libcmix-network/connect.cpp
@@ -96,6 +96,8 @@ void async_connect(tcp::socket& socket, std::string host, std::string next_port,
boost::asio::ip::basic_resolver<tcp> resolver(socket.get_io_service());
boost::asio::ip::basic_resolver_query<tcp> query(host, next_port);
+ BOOST_LOG_TRIVIAL(trace) << "connecting to: \"" << host << ":" << next_port << "\"";
+
auto it = resolver.resolve(query);
std::shared_ptr<IterationInfo> info = std::make_shared<IterationInfo>(0, it, socket.get_io_service());