In the last chapter, our chat server was fairly simple and couldn't really do anything genuinely useful, but it served as a nice primer into socket communications.
Now we will start getting more serious about socket communication and server functionality. We shall implement a client server framework that transmits real-time information from the server and also creates a base for future extensions of supported functionalities.
The first thing when more advanced communications are expected between clients and servers, a protocol needs definition. There are different approaches to writing a communication protocol between programs. You can roughly divide them in two categories: human readable protocols and binary protocols. Human readable protocols are easy to understand and debug, but they are perhaps somewhat wasteful in resources as they use more space and have more data to transmit. In this book, we will stick to a human readable one. As a learning exercise, human readable...