I am trying to send a small payload over UDP and wanted to know, as the documentation is hard to find for unions, how the encoding works for unions.
1. Do unions take up a byte-size equivalent to their largest data type within? 2. And if not, how is union memory allocated? 3. Will I be using more data for a union with 5 members vs 100 members? 4. Is it better to use a union or send an enum "packed type" to describe the data? Regarding #4: I am sending a list of structs containing different game-related data (essentially packets of data - connect, spawn, move). I can either use the union's *.which()* function to see the struct type sent and place all struct types within the union or... Is it more size-efficient to not use unions and simply send over an enum(s) to determine the struct type on the receiving side? Thanks much! -- 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 [email protected]. Visit this group at https://groups.google.com/group/capnproto.
