little indian or big indian?
-
hi all! does anyone knows if there is a "strong" specification on sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order? thanks all! :)
-
hi all! does anyone knows if there is a "strong" specification on sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order? thanks all! :)
-
hi all! does anyone knows if there is a "strong" specification on sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order? thanks all! :)
JonathanLivingstone wrote:
Do i HAVE TO send any integer in my structs in any specific byte-order?
Only if you want it to work correctly! http://en.wikipedia.org/wiki/Endianness[^]
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real"
Score: 1.0 in the Soap Boxled mike
-
hi all! does anyone knows if there is a "strong" specification on sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order? thanks all! :)
If you control both the sending and receiving programs, then no. Bytes are just bytes. Where endian-ness comes into play is when you're using the low-level socket APIs, where the structs require integers to be in network byte order. If you don't control the receiving end, then follow whatever data format it's expecting.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
hi all! does anyone knows if there is a "strong" specification on sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order? thanks all! :)
-
JonathanLivingstone wrote:
little indian or big indian?
I thought you guys are talking about Little India Town, like Little Italy or Korea Town, in Toronto :-D
Best, Jun
-
If you control both the sending and receiving programs, then no. Bytes are just bytes. Where endian-ness comes into play is when you're using the low-level socket APIs, where the structs require integers to be in network byte order. If you don't control the receiving end, then follow whatever data format it's expecting.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
uh? endianness is a platform issue not an application "control" issue. :confused:
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real"
Score: 1.0 in the Soap Boxled mike
The OP asked whether he has to send his own data in a particular endian order. The answer is no, his data is just bytes to the network stack, endian-ness doesn't enter into play at that high a level.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
The OP asked whether he has to send his own data in a particular endian order. The answer is no, his data is just bytes to the network stack, endian-ness doesn't enter into play at that high a level.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Michael Dunn wrote:
The OP asked whether he has to send his own data in a particular endian order.
I don't know that that is supposed to mean but here is what he asked:
JonathanLivingstone wrote:
sending numeric data using TCP/IP protocol? Do i HAVE TO send any integer in my structs in any specific byte-order?
and the answer is "yes". integers are multi-byte width and therefore byte order is significant for TCP/IP.
"Alot of the people on this forum are incredibly stupid, thinking that the internet is real"
Score: 1.0 in the Soap Boxled mike
-
JonathanLivingstone wrote:
little indian or big indian?
I thought you guys are talking about Little India Town, like Little Italy or Korea Town, in Toronto :-D
Best, Jun