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.
|