Setting the user timeout in Linux is a bit tricky. I'd have to google for details myself.
The exit from telnet is simple, though. It's simply end-of-file. If you're running a telnet session from a script, the end of the stdin stream will disconnect. For interactive sessions, type Ctrl-D, just as you would to logout.
An IDE is no substitute for an Intelligent Developer.
Bring out your dead! Or a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads