diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/cmixclient.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/client/cmixclient.cpp b/client/cmixclient.cpp index 1ffd904..933ad0e 100644 --- a/client/cmixclient.cpp +++ b/client/cmixclient.cpp @@ -43,14 +43,19 @@ void CMixClient::handle_message(int node_id, cmix_proto::CMixMessage message) handle_key_exchange(node_id, *message.mutable_keyexchange()); return; } + case cmix_proto::CMixMessage::ContentsCase::kBye: { + network_connections.at(node_id).close(); + if(std::all_of(network_connections.begin(), network_connections.end(), [](SenderReceiver const& c) { return c.is_open(); })) { + break; + } else { + return; + } + } default: { BOOST_LOG_TRIVIAL(error) << "Received unknown message"; } } - for(auto&& connection : network_connections) { - connection.close(); - } io_service.stop(); } |
