Microservices have become increasingly popular in recent years. The idea of microservices is that large programming problems can be split up into many small subsystems that communicate over a network. For example, if your program needs to format a string, you could add code to your program to do that, but writing code is hard. Alternatively, you could keep your program simple and instead connect to a service that provides string formatting for you. This has the added advantage that many programs can use this same service without reinventing the wheel.
Unfortunately, the microservice paradigm has largely avoided the C ecosystem; until now!
As a motivating example, we are going to build a TCP server that converts strings into uppercase. If a client connects and sends
Hello, then our program will send
HELLO back. This will serve as a very basic microservice. Of course, a real-world microservice might do something a bit more advanced (such as left-pad a string), but this to-uppercase...