de.mud.telnet
public abstract class TelnetProtocolHandler extends java.lang.Object
Maintainer: Marcus Meissner
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
contains the current revision id
|
Constructor and Description |
---|
TelnetProtocolHandler()
Create a new telnet protocol handler.
|
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
getTerminalType()
Get the current terminal type for TTYPE telnet option.
|
protected abstract java.awt.Dimension |
getWindowSize()
Get the current window size of the terminal for the
NAWS telnet option.
|
void |
inputfeed(byte[] b,
int len) |
int |
negotiate(byte[] nbuf)
Handle telnet protocol negotiation.
|
protected abstract void |
notifyEndOfRecord()
Generate an EOR (end of record) request.
|
void |
reset()
Reset the protocol handler.
|
void |
sendTelnetControl(byte code)
Send a Telnet Escape character (IAC
) |
void |
setCR(java.lang.String xcr) |
void |
setCRLF(java.lang.String xcrlf) |
protected abstract void |
setLocalEcho(boolean echo)
Set the local echo option of telnet.
|
void |
setWindowSize(int columns,
int rows)
Send the new Window Size (via NAWS)
|
void |
startup()
Do not send any notifications at startup.
|
void |
transpose(byte[] buf)
Transpose special telnet codes like 0xff or newlines to values
that are compliant to the protocol.
|
protected abstract void |
write(byte[] b)
Send data to the remote host.
|
public static final java.lang.String ID
public TelnetProtocolHandler()
protected abstract java.lang.String getTerminalType()
protected abstract java.awt.Dimension getWindowSize()
protected abstract void setLocalEcho(boolean echo)
echo
- true for local echo, false for no local echoprotected abstract void notifyEndOfRecord()
protected abstract void write(byte[] b) throws java.io.IOException
b
- array of bytes to sendjava.io.IOException
public void reset()
public void sendTelnetControl(byte code) throws java.io.IOException
)
java.io.IOException
public void setWindowSize(int columns, int rows) throws java.io.IOException
java.io.IOException
public void startup() throws java.io.IOException
java.io.IOException
public void transpose(byte[] buf) throws java.io.IOException
buf
- the data buffer to be sentjava.io.IOException
public void setCRLF(java.lang.String xcrlf)
public void setCR(java.lang.String xcr)
public int negotiate(byte[] nbuf) throws java.io.IOException
nbuf
- the byte buffer put out after negotiationjava.io.IOException
public void inputfeed(byte[] b, int len)