Datagram truncation with recvfrom

A UDP sender transmits three datagrams to a receiver, in order, carrying 600, 1200 and 300 bytes of payload. Assume all three arrive in order and none is lost. The receiver, on Linux, calls recvfrom() three times, each time with a 1024-byte buffer and no flags. Give the number of bytes the first call returns, the number of bytes the second call returns, and the number of payload bytes that are discarded and never delivered to the application. Answer each as an exact integer number of bytes.

Your answers

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: