Class telnet

Class telnet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----telnet

public class telnet
extends Applet
implements Runnable, TerminalHost, StatusPeer
A telnet implementation that supports different terminal emulations.
Version:
$Id: telnet.java,v 1.19 1998/02/09 10:22:15 leo Exp $
Author:
Matthias L. Jugel, Marcus Mei▀ner

Variable Index

 o address
The host address to connect to.
 o emulation
Emulation type (default is vt320).
 o modules
Dynamically loaded modules are stored here.
 o params
This Hashtable contains information retrievable by getParameter() in case the program is run as an application and the AppletStub is missing.
 o port
The port number (default ist 23).
 o proxy
The proxy ip address.
 o proxyport
The proxy port number.
 o term
The terminal emulation (dynamically loaded).
 o tio
The telnet io methods.

Constructor Index

 o telnet()

Method Index

 o connect()
Connect to the specified host and port but don't break existing connections.
 o connect(String)
Connect to the specified host and port but don't break existing connections.
 o connect(String, int)
Connect to the specified host and port but don't break existing connections.
 o disconnect()
Disconnect from the remote host.
 o getAppletInfo()
Retrieve the current version of the applet.
 o getParameter(String)
We override the Applet method getParameter() to be able to handle parameters even as application.
 o getParameterInfo()
Retrieve parameter tag information.
 o init()
Initialize applet.
 o main(String[])
The main function is called on startup of the application.
 o notifyStatus(Vector)
This method is called when telnet needs to be notified of status changes.
 o run()
Try to read data from the sockets and put it on the terminal.
 o send(String)
Send a String to the remote host.
 o start()
Upon start of the applet try to create a new connection.
 o stop()
Disconnect when the applet is stopped.
 o writeToSocket(String)
Send a String to the remote Host.
 o writeToUser(String)
Send a String to the users terminal

Variables

 o tio
  protected TelnetIO tio
The telnet io methods.
See Also:
TelnetIO
 o term
  protected Terminal term
The terminal emulation (dynamically loaded).
See Also:
emulation, Terminal, TerminalHost
 o address
  protected String address
The host address to connect to. This is retrieved from the PARAM tag "address".
 o port
  protected int port
The port number (default ist 23). This can be specified as the PARAM tag "port".
 o proxy
  protected String proxy
The proxy ip address. If this variable is set telnet will try to connect to this address and then send a string to tell the relay where the target host is.
See Also:
address
 o proxyport
  protected int proxyport
The proxy port number. This is the port where the relay is expected to listen for incoming connections.
See Also:
proxy, port
 o emulation
  protected String emulation
Emulation type (default is vt320). This can be specified as the PARAM tag "emulation".
See Also:
term, Terminal, TerminalHost
 o modules
  protected Vector modules
Dynamically loaded modules are stored here.
 o params
  public Hashtable params
This Hashtable contains information retrievable by getParameter() in case the program is run as an application and the AppletStub is missing.

Constructors

 o telnet
  public telnet()

Methods

 o getAppletInfo
  public String getAppletInfo()
Retrieve the current version of the applet.
Returns:
String a string with the version information.
Overrides:
getAppletInfo in class Applet
 o getParameterInfo
  public String[][] getParameterInfo()
Retrieve parameter tag information. This includes the tag information from terminal and loaded modules.
Returns:
String an array of array of string with tag information
Overrides:
getParameterInfo in class Applet
See Also:
getParameterInfo
 o getParameter
  public String getParameter(String name)
We override the Applet method getParameter() to be able to handle parameters even as application.
Parameters:
name - The name of the queried parameter.
Returns:
the value of the parameter
Overrides:
getParameter in class Applet
See Also:
getParameter
 o main
  public static void main(String args[])
The main function is called on startup of the application.
 o init
  public void init()
Initialize applet. This method reads the PARAM tags "address", "port" and "emulation". The emulation class is loaded dynamically. It also loads modules given as parameter "module#".
Overrides:
init in class Applet
 o start
  public void start()
Upon start of the applet try to create a new connection.
Overrides:
start in class Applet
 o stop
  public final void stop()
Disconnect when the applet is stopped.
Overrides:
stop in class Applet
 o run
  public void run()
Try to read data from the sockets and put it on the terminal. This is done until the thread dies or an error occurs.
 o connect
  public boolean connect()
Connect to the specified host and port but don't break existing connections. Connects to the host and port specified in the tags.
Returns:
false if connection was unsuccessful
 o connect
  public boolean connect(String host)
Connect to the specified host and port but don't break existing connections. Uses the port specified in the tags or 23.
Parameters:
host - destination host address
 o connect
  public boolean connect(String host,
                         int prt)
Connect to the specified host and port but don't break existing connections.
Parameters:
host - destination host address
prt - destination hosts port
 o disconnect
  public boolean disconnect()
Disconnect from the remote host.
Returns:
false if there was a problem disconnecting.
 o send
  public boolean send(String str)
Send a String to the remote host. Implements display.TerminalHost
Parameters:
s - String to be sent
Returns:
true if we are connected
See Also:
TerminalHost
 o writeToSocket
  public boolean writeToSocket(String str)
Send a String to the remote Host.
Parameters:
str - String to be sent
Returns:
true if we are connected
See Also:
BSXModule
 o writeToUser
  public void writeToUser(String str)
Send a String to the users terminal
Parameters:
str - String to be displayed
Returns:
void
See Also:
BSXModule
 o notifyStatus
  public Object notifyStatus(Vector status)
This method is called when telnet needs to be notified of status changes.
Parameters:
status - Vector of status information.
Returns:
an object of the information requested.
See Also:
StatusPeer