I’ve been having trouble with Datagram. I’m using it to pack packets with enet (i.e. not using Panda sockets). As a test I just added a Datagram that has a uint32 added. Then in the server code I extract the Datagram and uint32 using the DatagramIterator. However, although the hex dump is identical for the datagram on both machines, when calling get_uint32() the value is different.
I wondered if anyone had any ideas. Other than trying it with Panda sockets. I can send a struct through with no problem. I’m pretty sure I had this same issue with the Panda socket API as well though, so maybe I’m doing something weird.
I was using Windows 7 for the client and Windows 8.1 for the Server. I’m on the same machine now. Having looked a bit closer it seems the hex data dump I’m receiving is larger and different, but the data size is the same, so I’m a bit stumped by that at the moment. I thought using the Datagram would work ok, but maybe I need to do proper serialization.
Using two machines again, the data I send and receive is the same but the data is being changed when I extract it from packet->data, even on the client before I send the packet: