I need to send a request via a python socket with the following structure:
{
Uint16 data_one
Uint16 data_one
Uint32 data_one
}
I have my server and client working, but i do not really know how can i encode and decode this kind of data to send it over the socket. Thanks!
Take a look at the functions in the
structmodule. Usestruct.packto generate the bytestream and send it over the wire, then usestruct.unpackon the other end to unpack the data: