Ways to have a Multi-Connection Server ... Have a Single Connection Server The second client waits according to the 'listen' The client waits inside of 'connect' Works if that's all that's possible Works if there is only one client Contra-indicated where each connection takes long latency but little CPU-time Advantages: Easy to code Easy to debug Uses least resources Batman Disadvantages Can add *lots* of latency Use Fork Simply fork off a process per thread Contra-indicated if connections must heavily interact Advantages: Mostly easy to code Hide's bugs (apache story) Easily uses multiprocessing Disadvantages Can be slow Can use lots of RAM and CPU Annoying to Debug Some portability problems Can overwhelm the machine Use Threads Simply fork off a thread per connection Advantages: Kinda easy to code sorta Uses some resources (less than fork, more than select/poll) Easy portability Easily uses multiprocessing Easy to add an update the screen Disadvantages: Uses some resources (less than fork, more than select/poll) Debugging is bad or worse Bugs propogate Must lock lock lock Might overwhelm the machine (less than fork) Use Select or Poll or Epoll Make an array of connections Use select or poll or epoll to see who needs attention