c++ - Variable sized packet -
i trying define packet length determined during ns-3 simulation (think of packet sent on downlink containing schedule information length depends on number of nodes in network can join/leave network during simulation). have idea how approach this?
the traditional solution send length first, followed data:
+------------+---------------------+ | uint32_t n | n - 4 bytes of data | +------------+---------------------+
to decode, read first 4 bytes, , use value in bytes determine how more data there is.
Comments
Post a Comment