recv returns the number of bytes received, or -1 if there is an error.
The only way it can return 0 is if a 0-byte message is received
(e.g. a 0-length UDP packet). While I'll agree that complaints about
size and signed-ness mismatches are a Good Thing, the above code
suffers from the (IMHO) much worse problem of failing to check for
an error return from recv....
-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
Systems Programmer
School of Computer Science - Research Computing Facility
Carnegie Mellon University - Pittsburgh, PA