Dave Thompson <da*************@worldnet.att.net> writes:
On 17 May 2005 18:03:40 -0700, "baumann@pan" <ba*********@gmail.com>
wrote:
[...]
since tlen is less than 2 bytes, you should use htons() instead.
is _exactly_ 2 bytes, on "normal" systems with 8-bit byte and 16-bit
short, which is not absolutely everywhere but does include the placesn
sockets functions like these (and maybe Unix I/O in general) are
likely to be available and work as expected.
I've used Unix systems where short is 32 bits, and others where it's
64 bits (both Crays). Along with CHAR_BIT==8 and the lack of extended
integer types, this implies that there is no 16-bit integer type,
which makes some of the network stuff interesting (it uses bit
fields).
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.