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

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

Introduction

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

Prototype


public TelnetClient(String termtype) 

Source Link

Document

Construct an instance with the specified terminal type.

Usage

From source file:com.leosys.core.telnet.Telent.java

public Telent(String hostname, int hostport, String user, String password) throws SocketException, IOException {
    super();/*from   www.j  av  a  2  s.  co m*/
    this.hostname = hostname;
    this.hostport = hostport;
    this.user = user;
    this.password = password;

    telnet = new TelnetClient("VT100");// VT100 VT52 VT220 VTNT ANSI  
    telnet.connect(hostname, hostport);
    in = telnet.getInputStream();
    out = new PrintStream(telnet.getOutputStream());

    readUntil("login: ");
    write(user);
    write("\n");
    readUntil("Password: ");
    write(password);
    write("\n");
}

From source file:com.motorola.studio.android.utilities.TelnetFrameworkAndroid.java

/**
 * Connect to a device using telnet./*from w  w  w.  ja  va 2s .com*/
 * 
 * @param telnetHost
 *            the telnet host IP address
 * @param telnetPort
 *            the telnet port
 * 
 * @throws MotodevException
 *             when the connection cannot be established
 */
public synchronized void connect(String telnetHost, int telnetPort) throws IOException {
    if ((telnetClient == null) || ((telnetClient != null) && (!telnetClient.isConnected()))) {
        telnetClient = new TelnetClient(telnetHost);
        telnetClient.connect(telnetHost, telnetPort);
    }
}

From source file:onl.netfishers.netshot.device.access.Telnet.java

@Override
public void connect() throws IOException {
    this.telnet = new TelnetClient("VT100");
    telnet.setConnectTimeout(this.connectionTimeout);
    telnet.connect(this.host.getInetAddress(), this.port);
    telnet.setSoTimeout(this.receiveTimeout);
    this.inStream = telnet.getInputStream();
    this.outStream = new PrintStream(telnet.getOutputStream());
}