com.mindbright.net.telnet
public class TelnetTerminalAdapter extends TerminalInputChaff implements TelnetEventHandler
TerminalWindow to a
telnet server.TelnetNVT,
TerminalWindow,
TerminalInputChaff| Constructor and Description |
|---|
TelnetTerminalAdapter(java.io.InputStream in,
java.io.OutputStream out,
TerminalWindow terminal)
Connects the given
TerminalWindow to a telnet
server at the other end of the provided streams. |
| Modifier and Type | Method and Description |
|---|---|
TelnetNVT |
getTelnetNVT()
Get the underlying telnet protocol instance.
|
void |
interpretAsCommand(int cmd)
Called to handle some telnet protocol commands from the server.
|
boolean |
isBuffered()
Tells if input is sent directly to server (raw mode) or line by
line (cooked).
|
boolean |
optionNegotiation(int option,
int request)
Called to handle option negotiation packets from the server.
|
void |
optionSubNegotiation(int option,
byte[] params)
Called to handle option negotiation packets from the server.
|
void |
receiveData(byte b)
Handle a byte received from the server.
|
void |
sendBreak()
Send a break to the terminal server.
|
void |
sendBytes(byte[] b)
Send a number of bytes to the server.
|
void |
sendBytesDirect(byte[] b)
Send a number of bytes directly to the server.
|
protected void |
sendFakeChar()
Send a fake character to the server.
|
protected void |
sendTypedChar(int c)
Send a typed char to the server.
|
void |
signalWindowChanged(int rows,
int cols,
int vpixels,
int hpixels)
Tell the telnet server that our window has changed size.
|
dispenseChaff, isChaffActive, run, signalTermTypeChanged, startChaff, stopChaff, typedChar, typedCharpublic TelnetTerminalAdapter(java.io.InputStream in,
java.io.OutputStream out,
TerminalWindow terminal)
TerminalWindow to a telnet
server at the other end of the provided streams.in - stream from which data from the telnet server is readout - stream over which to send data to the telnet serverterminal - instance of terminal window to connect topublic TelnetNVT getTelnetNVT()
public boolean isBuffered()
public void interpretAsCommand(int cmd)
TelnetEventHandlerinterpretAsCommand in interface TelnetEventHandlerpublic void optionSubNegotiation(int option,
byte[] params)
throws java.io.IOException
TelnetEventHandlersendOptionSubNegotiationoptionSubNegotiation in interface TelnetEventHandlerjava.io.IOExceptionpublic boolean optionNegotiation(int option,
int request)
throws java.io.IOException
TelnetEventHandlerdoOption and willOptionoptionNegotiation in interface TelnetEventHandlerjava.io.IOExceptionpublic void receiveData(byte b)
TelnetEventHandlerreceiveData in interface TelnetEventHandlerprotected void sendTypedChar(int c)
sendTypedChar in class TerminalInputChaffc - typed characterprotected void sendFakeChar()
TerminalInputChaffsendFakeChar in class TerminalInputChaffpublic void sendBytes(byte[] b)
sendBytes in interface TerminalInputListenerb - array of bytes representing characters to inputpublic void sendBytesDirect(byte[] b)
sendBytesDirect in interface TerminalInputListenerb - array of bytes representing characters to sendpublic void signalWindowChanged(int rows,
int cols,
int vpixels,
int hpixels)
signalWindowChanged in interface TerminalInputListenerrows - new number of rowscols - new number of columnsvpixels - number of verticial pixelshpixels - number of horizontal pixelspublic void sendBreak()
sendBreak in interface TerminalInputListenersendBreak in class TerminalInputChaff