java.lang.Object
com.googlecode.lanterna.terminal.AbstractTerminal
com.googlecode.lanterna.terminal.ansi.StreamBasedTerminal
com.googlecode.lanterna.terminal.ansi.ANSITerminal
com.googlecode.lanterna.terminal.ansi.TelnetTerminal
- All Implemented Interfaces:
Scrollable,InputProvider,ExtendedTerminal,Terminal,Closeable,AutoCloseable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class contains some of the various states that the Telnet negotiation protocol defines. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the socket to the client, effectively ending the telnet session and the terminal.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 socket address for the remote endpoint of the telnet connectionMethods inherited from class com.googlecode.lanterna.terminal.ansi.ANSITerminal
clearScreen, deiconify, disableSGR, enableSGR, enterPrivateMode, exitPrivateMode, findTerminalSize, getCursorPosition, getDefaultKeyDecodingProfile, getTerminalSize, iconify, maximize, pollInput, popTitle, pushTitle, readInput, resetColorAndSGR, scrollLines, setBackgroundColor, setCursorPosition, setCursorPosition, setCursorVisible, setForegroundColor, setMouseCaptureMode, setTerminalSize, setTitle, unmaximizeMethods inherited from class com.googlecode.lanterna.terminal.ansi.StreamBasedTerminal
bell, enquireTerminal, flush, getCharset, getInputDecoder, putCharacter, putString, translateCharacter, writeToTerminalMethods inherited from class com.googlecode.lanterna.terminal.AbstractTerminal
addResizeListener, newTextGraphics, onResized, onResized, removeResizeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.googlecode.lanterna.terminal.Terminal
addResizeListener, bell, enquireTerminal, flush, newTextGraphics, putCharacter, putString, removeResizeListener
-
Method Details
-
getRemoteSocketAddress
Returns the socket address for the remote endpoint of the telnet connection- Returns:
- SocketAddress representing the remote client
-
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
Closes the socket to the client, effectively ending the telnet session and the terminal.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceTerminal- Overrides:
closein classANSITerminal- Throws:
IOException- If there was an underlying I/O error
-