Skip to Content.
Sympa Menu

freetds - Re: money wire format

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Mark J. Lilback" <mark AT lilback.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Cc: "Lowden, James K" <LowdenJK AT bernstein.com>
  • Subject: Re: money wire format
  • Date: Wed, 7 Aug 2002 16:20:23 -0400


At 1:54 PM -0400 8/7/2002, Lowden, James K wrote:
Also I recently discovered the function ntohs. I wonder how tds_swap_bytes
is different, and how to know which to use when. I see of course they have
different semantics, but it seems like their purpose is the same.

ntohs converts to little-endian format if on a little-endian platform, and does nothing if on a big-endian platform. The assumption is that network traffic is always big-endian.

I'd imagine tds_swap_bytes just swaps, without regard for endian-ness of the host.

--
__________________________________________________________________________
"They that can give up essential liberty
Mark J. Lilback to obtain a little temporary safety
<mark AT lilback.com> deserve neither liberty or safety."
http://www.lilback.com/ -- Benjamin Franklin




Archive powered by MHonArc 2.6.24.

Top of Page