Subj : sockets To : comp.programming.threads From : puzzlecracker Date : Tue Feb 22 2005 07:30 am the function msg_receive, fd is a socket connected to a remote Internet client. What is wrong with msg_receive? Suggest a fix. #define MAXVALS 65536 typedef struct _msg_t { unsigned int num; unsigned int values[MAXVALS]; } msg_t; int msg_receive (int fd, msg_t *m) { size_t sz = sizeof (unsigned int); assert (m); if (read (fd, (void *)&m->num, sz) < sz) return -1; return read (fd, (void *)&m->values, sz * m->num); } .