I am trying to come up with a design to efficiently send a tree data structure (each node can have more than 2 branches) to a socket/different process etc. There seems to be a cap on how much data can be sent in one message (1500 Bytes). The tree data structure can get very big (into 100s of nodes may be). I initially started off by thinking of having a linear data structure like an array (example: [root, number of top nodes, node1, node2, node3 ..., number of next level node, node1, node2 , node3 and so on] and serializing this and sending it to the other process thorough a socket.
I am trying to figure out the most efficient way to do this given the constraints ( large tree, how to split given the limit on number of bytes per message)
I am yet to explore if I should use Protobuf, XDR , JSON for interprocess communication
What I have tried:
Just in the design phase. Learning how to go about this