I recently read this article describing an idea called Let Me Know. I’ve been intending to design ever more little throwaway protocols, Internet protocols that solve some purpose and can be discarded at the first sign of inconvenience, so I implemented my version of Let Me Know which I’ve named For Your Information or FYI for short. It’s a UDP service that runs over port 411 by default, and the design is very simple: The opaque tag for some event is sent in a packet, and the server sends the tag back when the event has happened, otherwise it sends back an empty packet. So many people want to throw in JSON, or HTTP, or some other complication that adds a particular flavour and a lot of implicit behaviour in their designs. Well, this is about as simple a design as can solve the problem without arbitrary decisions.
I’m getting better at using tasks, and there’s a much more complex UDP protocol whose partial implementation is sitting in my working directory for over a year, Pest. I’m thinking I’ll finish that one soon enough. I’m particularly pleased with how I implemented tag ingestion here. The server program has two main tasks: one for responding to UDP requests, and one for adding tags. The latter will kill the program if its protocol is violated, such as getting an error in reading, receiving an oversized tag, or receiving an empty tag. It took a bit of work to make sure it would all go together smoothly, but I’m largely pleased with the result. The task management was much easier when I tried to have the latter task kill the program carelessly, but it’s not much worse with a more structured approach. The program will wait until the next request before the responding task can accept the Stop rendezvous, however.
In any case, writing this was fun, and I look forward to sharing more Ada programs I’ve written with you soon.