kawa

Class Telnet

public class Telnet extends Object implements Runnable

Encapsulates the state of a telnet connection. When run as an application, is a a minimal telnet client.
Field Summary
static intDO
Indicates the request that the other party perform, or confirmation that you are expecting the other party to perform, the indicated option.
static intDONT
static intECHO
static intSUPPRESS_GO_AHEAD
byte[]terminalType
shortwindowHeight
shortwindowWidth
static intWILL
Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.
static intWONT
Indicates the refusal to perform,or continue performing, the indicated option.
Constructor Summary
Telnet(Socket socket, boolean isServer)
Method Summary
TelnetInputStreamgetInputStream()
TelnetOutputStreamgetOutputStream()
static voidmain(String[] args)
voidrequest(int command, int option)
Request (from this side) a new option state.
voidrun()
voidsubCommand(byte[] buf, int off, int len)
Handle a sub-command (SB-sequence) that we received.

Field Detail

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.

DONT

public static final int DONT

ECHO

public static final int ECHO

SUPPRESS_GO_AHEAD

public static final int SUPPRESS_GO_AHEAD

terminalType

public byte[] terminalType

windowHeight

public short windowHeight

windowWidth

public short windowWidth

WILL

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

WONT

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

Constructor Detail

Telnet

public Telnet(Socket socket, boolean isServer)

Method Detail

getInputStream

public TelnetInputStream getInputStream()

getOutputStream

public TelnetOutputStream getOutputStream()

main

public static void main(String[] args)

request

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

run

public void run()

subCommand

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