4.11 Summary


All clients and servers begin with a call to socket , returning a socket descriptor. Clients then call connect , while servers call bind , listen , and accept . Sockets are normally closed with the standard close function, although we will see another way to do this with the shutdown function (Section 6.6), and we will also examine the effect of the SO_LINGER socket option (Section 7.5).

Most TCP servers are concurrent, with the server calling fork for every client connection that it handles. We will see that most UDP servers are iterative. While these two models have been used successfully for many years , in Chapter 30 we will look at other server design options that use threads and processes.



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