I have a record:
Tconnecting = record
var
a: int64;
b: integer;
c: integer;
end;
which I need send to server using UDP protocol
I fill it
packet.a := StrToInt64('0x1234567890');
packet.b := 0;
packet.c := RandomRange(1, 9999999);
and sending it
SetLength(send_data, sizeof(packet));
send_data := RawToBytes(packet, SizeOf(packet));
udp.SendBuffer(make_it_big_endian(send_data)); <-- the question... "network byte order"
or maybe I'm doing something wrong? I need to send "bign endian" packet
pack("N*", int64, int, int); (this is in PHP)
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…