What a single recv returns on a TCP stream

A client opens a TCP connection and makes two calls, send(fd, a, 100, 0) followed immediately by send(fd, b, 200, 0), then waits for a reply without closing or shutting down its sending side. Both sends return their full counts. The server then makes a single blocking call recv(cfd, buf, 1024, 0) on the connected socket. Assume default socket options and that this receive call completes successfully. Which statement about that call's return value is correct?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Socket Communication Questions: