Sending UDP packets in the correct Endianness
问题 Hi Guys I’m having trouble understanding network byte ordering and the order in which data is sent and received over UDP. I'm using C# I have a structure holding: message.start_id = 0x7777CCCC; message.message _id = 0xBBB67000; more data the message definition has [StructLayout(LayoutKind.Sequential)] I first convert the structure to a byte array using: public byte[] StructureToByteArray(object obj) { int len = Marshal.SizeOf(obj); byte[] arr = new byte[len]; IntPtr ptr = Marshal.AllocHGlobal