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 Type
    Method
    Description
    default void
    The telnet connection closed.
    default void
    onCommand(byte command)
    Called when a telnet command is received.
    default void
    onData(byte[] data)
    Process data sent by the client.
    default void
    onEcho(boolean echo)
    Called when the ECHO option state changes.
    default void
    onNAWS(boolean naws)
    Called when the NAWS (Negotiate About Window Size) option state changes.
    default void
    The telnet connection opened.
    default void
    onReceiveBinary(boolean binary)
    Called when the receive binary mode state changes.
    default void
    onSendBinary(boolean binary)
    Called when the send binary mode state changes.
    default void
    onSGA(boolean sga)
    Called when the SGA (Suppress Go Ahead) option state changes.
    default void
    onSize(int width, int height)
    Called when the terminal window size changes.
    default void
    onTerminalType(String terminalType)
    Called when the terminal type is received from the client.
  • Method Details

    • onOpen

      default void onOpen(TelnetConnection conn)
      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 columns
      height - the new terminal height in rows
    • onTerminalType

      default void onTerminalType(String terminalType)
      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