Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Portable Endianness . . . . . . . . (was Re: Portability of Misaligned Data Access)



On 29/07/06, Jim <jep200404@example.com> wrote:

Josh Glover wrote:

> How about just always using htons(3) and htonl(3) to get compatible byte orders?

I do so for data communicated little-endian.

For data that is communicated big-endian,
I must write different routines, albeit similarly inspired.

Ah, I was being a bit short-sighted. I was imagining situations where
you are communicating data from a program you wrote on one machine to
a program you wrote (maybe the same one?) on another machine.

I failed to consider the case where you must respect an existing
protocol that you have no control over.

-Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links