Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

57.8. Exercises

  1. In Section 57.3, we noted that UNIX domain datagram sockets are reliable. Write programs to show that if a sender transmits datagrams to a UNIX domain datagram socket faster than the receiver reads them, then the sender is eventually blocked, and remains blocked until the receiver reads some of the pending datagrams.

  2. Rewrite the programs in Example 57-3 (us_xfr_sv.c) and Example 57-4 (us_xfr_cl.c) to use the Linux-specific abstract socket namespace (Section 57.6).

  3. Reimplement the sequence-number server and client of Section 44.8 using UNIX domain stream sockets.

  4. Suppose that we create two UNIX domain datagram sockets bound to the paths /somepath/a and /somepath/b, and that we connect the socket /somepath/a to /somepath/b. What happens if we create a third datagram socket and try to send (sendto()) a datagram via that socket to /somepath/a? Write a program to determine the answer. If you have access to other UNIX systems, test the program on those systems to see if the answer differs.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial