Example usage for org.apache.commons.net.telnet TelnetInputListener TelnetInputListener

List of usage examples for org.apache.commons.net.telnet TelnetInputListener TelnetInputListener

Introduction

In this page you can find the example usage for org.apache.commons.net.telnet TelnetInputListener TelnetInputListener.

Prototype

TelnetInputListener

Source Link

Usage

From source file:org.openhab.binding.heos.internal.resources.Telnet.java

/**
 * Input Listener which fires event if input is detected
 *///from w  ww  .  j  ava2s.  com

public void startInputListener() {
    inputListener = new TelnetInputListener() {
        @Override
        public void telnetInputAvailable() {
            inputAvailableRead();
        }
    };
    client.registerInputListener(inputListener);
}

From source file:org.openhab.binding.lutron.internal.net.TelnetSession.java

public TelnetSession() {
    this.telnetClient = new TelnetClient();
    this.charBuffer = CharBuffer.allocate(BUFSIZE);

    this.telnetClient.setReaderThread(true);
    this.telnetClient.registerInputListener(new TelnetInputListener() {
        @Override//from w  w w . j  ava 2s  . c  om
        public void telnetInputAvailable() {
            try {
                readInput();
            } catch (IOException e) {
                notifyInputError(e);
            }
        }
    });
}