Code Room
Code reviewMedium
Question
Review this C function that sends a buffer over a connected socket.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
int send_all(int fd, const char *buf, size_t len) { ssize_t n = send(fd, buf, len, 0); if (n < 0) { perror("send"); return -1; } return 0;}Run or narrate your approach, then ask the coach.