I think I figured it out, and as you (and I, really) suspected, it did have to do with alignment, but in a way I've never experienced. I was reading one byte off the wire when many more were pending. I then tried to read a big chunk (something like 20 bytes). For some reason, it skipped a byte between reading the single byte and reading the chunk, as if reads from the network can only occur in 16-bit hunks. If that's the case, I wasn't aware of it, and have never encountered it before. Anyway, the data I was expecting was offset by 8 bits, but because of some htons()-type stuff, it was a little opaque to me at first. Anyway, I think I've got that solved. Now onto further bugs....
_________________________
Bitt Faulk