kawa
Class Telnet

java.lang.Object
  extended by kawa.Telnet
All Implemented Interfaces:
java.lang.Runnable

public class Telnet
extends java.lang.Object
implements java.lang.Runnable

Encapsulates the state of a telnet connection. When run as an application, is a a minimal telnet client.


Field Summary
static int DO
          Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option.
static int DONT
           
static int ECHO
           
static int SUPPRESS_GO_AHEAD
           
 byte[] terminalType
           
static int WILL
          Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.
 short windowHeight
           
 short windowWidth
           
static int WONT
          Indicates the refusal to perform,or continue performing, the indicated option.
 
Constructor Summary
Telnet(java.net.Socket socket, boolean isServer)
           
 
Method Summary
 TelnetInputStream getInputStream()
           
 TelnetOutputStream getOutputStream()
           
static void main(java.lang.String[] args)
           
 void request(int command, int option)
          Request (from this side) a new option state.
 void run()
           
 void subCommand(byte[] buf, int off, int len)
          Handle a sub-command (SB-sequence) that we received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WILL

public static final int WILL
Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.

See Also:
Constant Field Values

WONT

public static final int WONT
Indicates the refusal to perform,or continue performing, the indicated option.

See Also:
Constant Field Values

DO

public static final int DO
Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option.

See Also:
Constant Field Values

DONT

public static final int DONT
See Also:
Constant Field Values

ECHO

public static final int ECHO
See Also:
Constant Field Values

SUPPRESS_GO_AHEAD

public static final int SUPPRESS_GO_AHEAD
See Also:
Constant Field Values

windowHeight

public short windowHeight

windowWidth

public short windowWidth

terminalType

public byte[] terminalType
Constructor Detail

Telnet

public Telnet(java.net.Socket socket,
              boolean isServer)
       throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getInputStream

public TelnetInputStream getInputStream()

getOutputStream

public TelnetOutputStream getOutputStream()

subCommand

public void subCommand(byte[] buf,
                       int off,
                       int len)
Handle a sub-command (SB-sequence) that we received.


request

public void request(int command,
                    int option)
             throws java.io.IOException
Request (from this side) a new option state. Command is one of DO, DONT, WILL, WONT.

Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)

run

public void run()
Specified by:
run in interface java.lang.Runnable