Only connect if command is issued...

else the connection breaks after a short interval. End session after sending command. If connection stays open other telnet clients are unable to connect as only one telnet connection is allowed. Also added various commands.