The MityDSP telnet server deamon allows you to easily add a telnet interface to your MityDSP based aplication. A telnet interface can be used for MityDSP device configuration and/or as a diagnostic aid.
The MityDSP telnet server class (tcTelnetd) provides a low level foundation for your application's command shell. The tcTelnetd class handles all of the low TCP socket interfaces and optionally can provide help in user authentication when a telnet client connects to your MityDSP device.
The tcTelnetd server class supports RFC 854 (support for TELNET external commands) and RFC 857 (support for remote echo control). Hooks are provided for handling commands, options set/request commands, and subnegotiation extraction according to RFC 854.
Once started, the tcTelnetd object will notify your application through callback functions when a new connection is established, when a user name needs verification, when a password needs verification, when data is received and when the client closes the telnet connection. Functions are also provided for your application to send text data to connected telnet clients.
The following simple example will start a telnet server which will support up to four simultaneous independant connections. Since writing a command shell is beyond the scope of this document (see the telnet server demo program) this simple example will simply echo characters back to the telnet client. When the telnet client sends a 'Z' the example will close the connection and when the telnet client sends a 'U' it will reply with a jovial message.