Saturday, August 8, 2009

Java based Telnet daemon

Telnetd is an Open Source effort to implement a Java telnet daemon that is compact and generic and thus easily embeddable into other applications.

Main Features are:
  • Telnet protocol implementation (following specifications, support for NVT, ECHO, TTYPE, NAWS, LINEMODE,NEWENV)
  • Terminal I/O with support for various terminal types
  • Simple UI toolkit as OO layer on top of the basic terminal I/O (work progress)
  • Connection management (host based access and handling of idle connections)
Main focus is a design that is flexible and powerful, yet at the same time stable and with a small runtime footprint. Threads required are two system threads per listener, as well as one per connection.
How To
For starting up the telnetd and the required number of listeners, you have two choices:
  1. using the existing main() in the TelnetD class
  2. instantiating and activating the daemon from within your application.
Bootstrapping from within your application
It will be required to take the following steps:
  1. Assemble/prepare the properties that resemble your desired configuration.
  2. Create a TelnetD instance using one of the given factory methods in the TelnetD class (see API docs).
  3. Start the daemon calling start()

An example is given below, props represents a single Properties instance containing all properties for your desired configuration:

//1. create singleton instance
TelnetD daemon = TelnetD.createTelnetD(props);
//2.start serving

No comments:

Post a Comment