A second year university project was to implement a client and server pair, following RFC2324 - the Hyper Text Coffee Pot Control Protocol. The protocol is based on HTTP, and adds some request methods and headers so that coffee may be brewed autonomously.
The RFC has a number of ambiguities, and points were awarded if you could show your server or client working successfully with someone else's software. I thought that this project provided a good insight into 'defensive' programming - following the spec, but being flexible in what you will accept. For example, the RFC discusses the "Cream" addition, but it would be wise to accept "CREAM", "cream" and even "CrEaM".
The compiled binary is avaliable with a config file here. As it is still an assessed piece of coursework, there is no source code and debug information has been removed from the binary.
Running ./coffee_server --help will give the following usage information:
$ ./coffee_server --help Usage: ./coffee_server [OPTION]... CoffeePot Server Default host: localhost Default port: 16000 Config file location: ./config.xml -c, --client HOST run as a client, connect to HOST -s, --server run as a server -p, --port PORT use this PORT -d, --debug [LEVEL] run at debug LEVEL (off is 0, default is 10) -?, --help show this helpProviding a debug level of 1000 or above will not start the server, but will instead process some test-case requests.