Re: Data transfer(little/big endian)
From: Phil Frisbie, Jr. (phil_at_hawksoft.com)
Date: 05/11/04
- Previous message: Andy: "Socket send blocking problem"
- In reply to: vipin: "Data transfer(little/big endian)"
- Next in thread: Eugene Gershnik: "Re: Data transfer(little/big endian)"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 11 May 2004 12:03:43 -0700
vipin wrote:
> Hello,
>
> I am wondering when I would face big endian and little endian issues over
> the network.
>
> I guess the issue is not with the network itself but in the host computers.
That is correct.
> let say the client machine is solaris and server is windows and I want to
> pass an integer
> across the network, I should run the ntohl and htonl at each connection
> endpoints so as to get in the proper host order.
That is one portable way to do it, however network byte order is big endian. If
most of your computers are running Windows (on little endian Intel/AMD cpus),
and you are sending a lot of data, then writing your own macros that use little
endian order will result in fewer data conversions.
> Is my understanding right or do I need to take care of some other thing too
> on transfer of data?
Floats need a little more care if you use a platform that does not support IEEE
format floats. And watch out for multibyte unicode strings....
> thank you
> vipin
-- Phil Frisbie, Jr. Hawk Software http://www.hawksoft.com
- Previous message: Andy: "Socket send blocking problem"
- In reply to: vipin: "Data transfer(little/big endian)"
- Next in thread: Eugene Gershnik: "Re: Data transfer(little/big endian)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|