Interface TelnetHandler
- All Known Implementing Classes:
TelnetTtyConnection
public interface TelnetHandler
The handler that defines the callbacks for a telnet connection.
- Author:
- Julien Viet
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonClose()The telnet connection closed.default voidonCommand(byte command) Called when a telnet command is received.default voidonData(byte[] data) Process data sent by the client.default voidonEcho(boolean echo) Called when the ECHO option state changes.default voidonNAWS(boolean naws) Called when the NAWS (Negotiate About Window Size) option state changes.default voidonOpen(TelnetConnection conn) The telnet connection opened.default voidonReceiveBinary(boolean binary) Called when the receive binary mode state changes.default voidonSendBinary(boolean binary) Called when the send binary mode state changes.default voidonSGA(boolean sga) Called when the SGA (Suppress Go Ahead) option state changes.default voidonSize(int width, int height) Called when the terminal window size changes.default voidonTerminalType(String terminalType) Called when the terminal type is received from the client.
-
Method Details
-
onOpen
The telnet connection opened.- Parameters:
conn- the connection
-
onClose
default void onClose()The telnet connection closed. -
onData
default void onData(byte[] data) Process data sent by the client.- Parameters:
data- the data
-
onSize
default 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
default void onCommand(byte command) Called when a telnet command is received.- Parameters:
command- the command byte
-
onNAWS
default 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
default void onEcho(boolean echo) Called when the ECHO option state changes.- Parameters:
echo- true if echo is enabled, false otherwise
-
onSGA
default void onSGA(boolean sga) Called when the SGA (Suppress Go Ahead) option state changes.- Parameters:
sga- true if SGA is enabled, false otherwise
-
onSendBinary
default 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
default void onReceiveBinary(boolean binary) Called when the receive binary mode state changes.- Parameters:
binary- true if binary mode is enabled for receiving, false otherwise
-