Exercises


16.1

In our discussion of Figure 16.10, we mentioned that the parent must call shutdown , not close . Why?

16.2

What happens in Figure 16.10 if the server process terminates prematurely, plus the child receives the EOF and terminates, but the child does not notify the parent?

16.3

What happens in Figure 16.10 if the parent dies unexpectedly before the child, and the child then reads an EOF on the socket?

16.4

What happens in Figure 16.11 if we remove the two lines

 
 if (n == 0) goto done; /* connect completed immediately */ 
16.5

In Section 16.3 we said that it is possible for data to arrive for a socket before connect returns. How can this happen?




UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net