Hi -
Sockets are intrinsically "binary" (for example, there's no such thing as "text mode" vs "binary mode" with a socket).
"char buff[BUFMAX]" is absolutely the right way to go, so you're covered there, too.
Byte order is definitely an issue:
Code:
// BAD: potential read error on different platforms
unsigned long u = 0xabcd;
write (s, &u, sizeof (unsigned long));
// BETTER (you'll need a corresponding "ntohl()" on the receiving end...)
unsigned long u = htonl (0xabcd);
write (s, &u, sizeof (unsigned long));
But basically, all of your reads and writes are just a binary byte stream. If you treat it as such, you should have no problem.
'Hope that helps .. PSM