I want to send something like data structure over tcp it might be class in Python. For example in C I have structure like this:
struct mstruct {
uint8_t b1;
uint8_t b2;
uint8_t b3;
uint8_t b4;
};
And if I want to send it over tcp I can use pointer to the structure. Send all 4 bytes with it and on the receiving side read them and cast to the same structure. Is it any way to do it in Python? If not what is the best solution for doing things like that?