Probably the problem is not in qints, but in alignment. On normal 32-bit system that structure most likely will look like this:
| version |xxxxxxxxx| length |
| checksum |xxxxxxxxx|xxxxxxxxx|
| version |xxxxxxxxx| length |
| checksum |xxxxxxxxx|xxxxxxxxx|
To copy to clipboard, switch view to plain text mode
but on x86 it can be also:
| version | length | chec |
| ksum |
| version | length | chec |
| ksum |
To copy to clipboard, switch view to plain text mode
If you rely on the order and position of structure elements, you should force compiler to pack the structure. If you use GCC, try:
struct DatagramHeader
{
...
} __attribute__ ((packed));
struct DatagramHeader
{
...
} __attribute__ ((packed));
To copy to clipboard, switch view to plain text mode
Bookmarks