general |
Aftersleep Books
|
||||||||||||||||||
Unix Network Programming Vol 1 The Sockets NetwThe following report compares books using the SERCount Rating (base on the result count from the search engine). |
|||||||||||||||||||
|
Aftersleep Books - 2005-06-20 07:00:00 | © Copyright 2004 - www.aftersleep.com () | sitemap | top |
After the concepts (a server 'listens' for a connection; a client initiates a connection) and basics of packets and sockets, the book presents a simple tcp server and client -- the server simply echos back whatever the client sends. Next, it discusses what can go wrong with the simple version, and presents an improved echo server that behave better when the client crashes (and likewise an improved client).
The book continues to improve on the basic client/server, including address resolution, and servers that handle multiple clients using forks, threads, non-blocking I/O. This is all I needed to learn from the book, and it's all in the first half of the book.
Particularly useful is Chapter 27, Client-Server Design Alternatives. To me it alone was worth the price of the book. Here the book discusses concurrent servers with three basic architectures:
(1) non-blocking I/O, no threads or forks (advantage: full control of resource allocation; disadvantag: complexity);
(2) spawn a thread or fork for each client (simplest implementation; potential problem of too many children);
(3) servers that pre-allocate a pool of threads or forks (a happy medium; faster).
Other chapters discuss broadcasting, multicasting, out of band data, routing sockets, and raw sockets; all topics I hope to learn some day. Again, this is a great book. The 3rd edition brings it up to date for IPV6 and numerous small improvements.