kawa

Class Telnet

Implemented Interfaces:
Runnable

public class Telnet
extends java.lang.Object
implements 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
static int
WILL
Indicates the desire to begin performing, or confirmation that you are now performing, the indicated option.
static int
WONT
Indicates the refusal to perform,or continue performing, the indicated option.
byte[]
terminalType
short
windowHeight
short
windowWidth

Constructor Summary

Telnet(java.net.Socket socket, boolean isServer)

Method Summary

TelnetInputStream
getInputStream()
TelnetOutputStream
getOutputStream()
static void
main(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.

Field Details

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.
Field Value:
253

DONT

public static final int DONT
Field Value:
254

ECHO

public static final int ECHO
Field Value:
1

SUPPRESS_GO_AHEAD

public static final int SUPPRESS_GO_AHEAD
Field Value:
3

WILL

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

WONT

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

terminalType

public byte[] terminalType

windowHeight

public short windowHeight

windowWidth

public short windowWidth

Constructor Details

Telnet

public Telnet(java.net.Socket socket,
              boolean isServer)
            throws java.io.IOException

Method Details

getInputStream

public TelnetInputStream getInputStream()

getOutputStream

public TelnetOutputStream getOutputStream()

main

public static void main(String[] args)

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.

run

public void run()

subCommand

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