feat: client can now receive MSG_CONCLUSION

This commit is contained in:
Sara Gerretsen 2025-11-04 11:41:22 +01:00
parent 4b6beed3d3
commit 3cc0513382

View file

@ -15,7 +15,7 @@ struct Connection {
std::optional<zmq::context_t> context{ std::nullopt };
std::optional<zmq::socket_t> socket{ std::nullopt };
std::recursive_mutex mtx;
std::optional<FixedVector<NetworkData::ClueID, 3>> conclusion{ std::nullopt };
FixedVector<NetworkData::ClueID, 3> conclusion{};
std::atomic<NetworkData::ConnectionStatus> status;
std::atomic<bool> stop_threads{ false };
};
@ -44,6 +44,13 @@ void handle_message(zmq::multipart_t const &message) {
case NetworkData::MSG_HEART:
multipart(NetworkData::MSG_BEAT).send(*connection->socket);
return;
case NetworkData::MSG_CONCLUSION:
print_line("Client: received conclusion:");
for (int i{ 1 }; i < 4; ++i) {
connection->conclusion.push_back(to_clue_id(message[i]));
print_line(" - ", connection->conclusion[i - 1]);
}
return;
default:
print_line("Client: Message not handled:");
print_message_contents(message);