Class TelnetHandler
java.lang.Object
org.aesh.terminal.telnet.TelnetHandler
- Direct Known Subclasses:
TelnetTtyConnection
The handler that defines the callbacks for a telnet connection.
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonClose()The telnet connection closed.protected voidonCommand(byte command) Called when a telnet command is received.protected voidonData(byte[] data) Process data sent by the client.protected voidonEcho(boolean echo) Called when the ECHO option state changes.protected voidonNAWS(boolean naws) Called when the NAWS (Negotiate About Window Size) option state changes.protected voidonOpen(TelnetConnection conn) The telnet connection opened.protected voidonReceiveBinary(boolean binary) Called when the receive binary mode state changes.protected voidonSendBinary(boolean binary) Called when the send binary mode state changes.protected voidonSGA(boolean sga) Called when the SGA (Suppress Go Ahead) option state changes.protected voidonSize(int width, int height) Called when the terminal window size changes.protected voidonTerminalType(String terminalType) Called when the terminal type is received from the client.
-
Constructor Details
-
TelnetHandler
public TelnetHandler()
-
-
Method Details
-
onOpen
The telnet connection opened.- Parameters:
conn- the connection
-
onClose
protected void onClose()The telnet connection closed. -
onData
protected void onData(byte[] data) Process data sent by the client.- Parameters:
data- the data
-
onSize
protected void onSize(int width, int height) Called when the terminal window size changes.- Parameters:
width- the new terminal width in columnsheight- the new terminal height in rows
-
onTerminalType
Called when the terminal type is received from the client.- Parameters:
terminalType- the terminal type string (e.g., "xterm", "vt100")
-
onCommand
protected void onCommand(byte command) Called when a telnet command is received.- Parameters:
command- the command byte
-
onNAWS
protected void onNAWS(boolean naws) Called when the NAWS (Negotiate About Window Size) option state changes.- Parameters:
naws- true if the client supports NAWS, false otherwise
-
onEcho
protected void onEcho(boolean echo) Called when the ECHO option state changes.- Parameters:
echo- true if echo is enabled, false otherwise
-
onSGA
protected void onSGA(boolean sga) Called when the SGA (Suppress Go Ahead) option state changes.- Parameters:
sga- true if SGA is enabled, false otherwise
-
onSendBinary
protected void onSendBinary(boolean binary) Called when the send binary mode state changes.- Parameters:
binary- true if binary mode is enabled for sending, false otherwise
-
onReceiveBinary
protected void onReceiveBinary(boolean binary) Called when the receive binary mode state changes.- Parameters:
binary- true if binary mode is enabled for receiving, false otherwise
-