Class TelnetTerminal

All Implemented Interfaces:
Scrollable, InputProvider, ExtendedTerminal, Terminal, Closeable, AutoCloseable

public class TelnetTerminal extends ANSITerminal
This class is used by the TelnetTerminalServer class when a client has connected in; this class will be the interaction point for that client. All operations are sent to the client over the network socket and some of the meta-operations (like echo mode) are communicated using Telnet negotiation language. You can't create objects of this class directly; they are created for you when you are listening for incoming connections using a TelnetTerminalServer and a client connects.

A good resource on telnet communication is http://www.tcpipguide.com/free/t_TelnetProtocol.htm
Also here: http://support.microsoft.com/kb/231866

Author:
martin
See Also:
  • Method Details

    • getRemoteSocketAddress

      public SocketAddress getRemoteSocketAddress()
      Returns the socket address for the remote endpoint of the telnet connection
      Returns:
      SocketAddress representing the remote client
    • getNegotiationState

      public TelnetTerminal.NegotiationState getNegotiationState()
      Retrieves the current negotiation state with the client, containing details on what options have been enabled and what the client has said it supports.
      Returns:
      The current negotiation state for this client
    • close

      public void close() throws IOException
      Closes the socket to the client, effectively ending the telnet session and the terminal.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface Terminal
      Overrides:
      close in class ANSITerminal
      Throws:
      IOException - If there was an underlying I/O error