If the sender is sending any number of different data types that have been 
serialized across the network, how does one know which type is coming in so 
that it can be pulled off using FlatArrayMessageReader's::getRoot<>?

E.g., say this while loop is constantly reading serialized data from the 
network and results in a vector of message buffers.

        for (auto& msg : messages) {
            auto arr = kj::ArrayPtr<const capnp::word>(
                reinterpret_cast<const capnp::word*>(msg),
                size / sizeof(capnp::word));
                
            capnp::FlatArrayMessageReader reader(arr);

            // how would one know what type to use here? 
            auto msg = reader.getRoot<?>();
        }

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/c89926fe-3b18-4e0f-9d30-8f8134b78a0an%40googlegroups.com.

Reply via email to