I find myself in need of a simple telnet server skeleton all the time. I've written one a long time ago, but could never find it again, until on attempt #9001 I did find it here:
From the example I have stripped all the code that made it actually do something, so we are left with a nice and simple telnet server skeleton that accepts the command: quit, help, command1, command2 and command3. Any and all questions are welcome.
Most of it can be written far more nicely, but I like the simple