I get the structure through the network from the C server to my Python client. UDP protocol. I do not control the server and its protocols / data formats. It consists of this structure (yes, IPv4 + port):
struct ip_s {
uint8_t i1;
uint8_t i2;
uint8_t i3;
uint8_t i4;
uint16_t port;
};
In addition to the port, which is converted to big-endian, data is sent "as is", discarded to (char*).
How can I get this structure in a format that Python processes?
Additional Information:
- Python 2.7 or 3.x
- Cross platform
- Preferred solution using only built-in modules
orlp source
share