Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux in General => Linux Development & Programming => Topic started by: sandeepvignesh on June 15, 2009, 04:20:47 AM

Title: endianess problem!!!!
Post by: sandeepvignesh on June 15, 2009, 04:20:47 AM
I have a small doubt regarding endianess. My system here is little endian and the board I am communicating with is big endian. Hence the data received by the board is not same as what I am sending. I have heard about htons and htonl,are they used only for IP address conversion or even for data? I just need to make sure that data should be matched both the sides,so can anybody please help me out!!!!Thanks in advance.......
Title: Re: endianess problem!!!!
Post by: dragoncity99 on October 29, 2009, 03:45:59 PM
I used to face this problem with my colleague when i was coding for C++ socket programming(Little Endian) to talk to Java(Big Endian). Both are intel x86 pcs.

We have to send a test string and do recvmsg on the string and dissect it to bit level. That's how we found the problem...