TCP really serves as the backbone of the modern internet experience. TCP is used by HTTP, the protocol that powers websites, and by Simple Mail Transfer Protocol (SMTP), the protocol that powers email.
In this chapter, we saw that building a TCP client was fairly straightforward. The only really tricky part was having the client monitor for local terminal input while simultaneously monitoring for socket data. We were able to accomplish this with
select() on Unix-based systems, but it was slightly trickier on Windows. Many real-world applications don't need to monitor terminal input, and so this step isn't always needed.
Building a TCP server that's suitable for many parallel connections wasn't much harder. Here,
select() was extremely useful, as it allowed a straightforward way of monitoring the listening socket for new connections while also monitoring existing connections for new data.
We also touched briefly on some common pain points. TCP doesn't provide a native way to partition...