On Monday, 3 August 2015 at 10:37:05 UTC, Dmitry Olshansky wrote:
On 03-Aug-2015 12:27, Dicebot wrote:
On Monday, 3 August 2015 at 09:21:50 UTC, Atila Neves wrote:

This deserialization will be identical to casting like this, right? (Not trying to diminish your work, just making sure I get semantics :))

struct UdpPacket
     static struct Header {
         ushort srcPort;
         ushort dstPort;
         ushort length;
         ushort checksum;

     Header   header;
     ubyte[0] data;

// ...

auto packet = cast(UdpPacket*) raw_data.ptr;

Plus/minus network byte order.

Oh yeah, and that. Cerealed always does network order.


Reply via email to