November 21, 2024, 09:50:38 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: endianess problem!!!!  (Read 5765 times)

Offline sandeepvignesh

  • Linux Noob !
  • *
  • Posts: 7
endianess problem!!!!
« 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.......

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
Re: endianess problem!!!!
« Reply #1 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...