Index

1. Server algorithms and their design


2. The basic server algorithm


3. Problems with the simple server?


4. Servers


5. Conclusions


6. Iterative connection oriented servers and connectionless servers


create a socket and bind
   to the well known address
   of the service being offered.

put socket into passive mode, making it
   ready for use by a server

loop
   accept the next connection
       request from the socket,
   and obtain a new socket
   for the connection


   repeat
      read a request from
          the client,
      generate a reply,
          send the reply
          back to the client
   until finished with the client ;
   close connection
end

8. Comments on algorithm


9. Implementation notes


10. Implementation notes


11. Iterative connectionless server


12. Implementation notes


13. Concurrent connection oriented servers and connectionless servers


create a socket and bind
    to the well known address
    for the service being offered

leave the socket unconnected


loop
   call recvfrom to obtain the
        next client request
   if (fork() == 0) {
       /* child process */
       do whatever the
          client request says
       form a reply and send
           it to client
       (use sendto)
       exit
   } else {
       /* must be the parent */
   }
end

15. Comments on the algorithm


16. Concurrent connection oriented server


create a socket and bind
   it to the well known address
   for the service being offered

place socket into passive mode
   making it ready for use by
   the server


loop
   call accept to receive the
   next request from a client
   if (fork() == 0) {
       /* must be the child */
       repeat
          read request from client
          do whatever the client
             request says
          form a reply and send
             it to client
       until client wishes to quit
       close connection
       exit
   } else {
       /* must be the parent */
   }
end

18. When to use each server type


19. Conclusion


Index

1. Server algorithms and their design
2. The basic server algorithm
3. Problems with the simple server?
4. Servers
5. Conclusions
6. Iterative connection oriented servers and connectionless servers
8. Comments on algorithm
9. Implementation notes
10. Implementation notes
11. Iterative connectionless server
12. Implementation notes
13. Concurrent connection oriented servers and connectionless servers
15. Comments on the algorithm
16. Concurrent connection oriented server
18. When to use each server type
19. Conclusion
Index

This document was produced using groff-1.22.