Last active
July 26, 2020 23:40
-
-
Save JohnMurray/0742c1e0c994764e1610b0b829c08702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void network_receive(MessageWrapper const& wrapper) { | |
if (wrapper.type_id == get_message_type_id<std::string>()) { | |
this->receive(*dynamic_cast<std::string *>(wrapper.value)); | |
} | |
else if (wrapper.type_id == get_message_type_id<SerializableHello>()) { | |
this->receive(*dynamic_cast<SerializableHello *>(wrapper.value)); | |
} | |
else { | |
// unknown | |
this->send_dead_letters(wrapper); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment