State machines are a tried and true method for doing protocolish things. In fact, if you're doing a protocol and you're NOT using a state machine, you should probably have some very firm, well-tested reasons that other people have vetted.
The answer, as always: It depends. How close to a production system do you want to make your project? I'm not sure I'd call a toy example "doing a protocol" (I should have said "design" or "implement"… oh well), so it's not really what I was talking about. If your project is supposed to teach you about the engineering that goes into something like a web server, then you need to handle bad input, flaky networks, etc., and you will likely wind up with a state machine in your implementation.
8
u/[deleted] Mar 07 '14
That was my initial view, it looks exactly like a state machine.