org.sadun.util
Class TelnetNVTChannel

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.sadun.util.TelnetInputStream
              extended byorg.sadun.util.TelnetNVTChannel

public class TelnetNVTChannel
extends TelnetInputStream

A telnet input stream to implement a Telnet NVT (Network Virtual Terminal) communication over a couple of paired input and output streams.

The class simply registers a org.sadun.util.TelnetInputStream.BasicNVTListner into a TelnetInputStream to handle DO and WILL commands rejecting every option.

Further handling of specific Telnet commands can be added by registering additional telnet command listeners with registerCommandListener().

A TelnetNVTChannel can be wrapped into a TelnetInputStreamConsumer to add input-consumption functionality.

Version:
1.0
Author:
Cristiano Sadun

Nested Class Summary
 
Nested classes inherited from class org.sadun.util.TelnetInputStream
TelnetInputStream.BasicNVTListener, TelnetInputStream.TelnetCommand, TelnetInputStream.TelnetCommandListener
 
Field Summary
 
Fields inherited from class org.sadun.util.TelnetInputStream
AO, AYT, BREAK, DM, DO, DONT, EC, EL, GA, IAC, IP, NOP, SB, SE, WILL, WONT
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
TelnetNVTChannel(java.io.InputStream is, java.io.OutputStream os)
          Create an instance on a couple of paired streams.
TelnetNVTChannel(java.net.Socket s)
          Create an instance over a socket connected to a TELNET host.
 
Methods inherited from class org.sadun.util.TelnetInputStream
commandHandled, getCommands, getDebugStream, read, registerTelnetCommandListener, removeTelnetCommandListener, setDebugStream
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TelnetNVTChannel

public TelnetNVTChannel(java.net.Socket s)
                 throws java.io.IOException
Create an instance over a socket connected to a TELNET host.

Parameters:
s - the connected socket
Throws:
java.io.IOException - if a problem arises obtaining the input/output streams of the socket

TelnetNVTChannel

public TelnetNVTChannel(java.io.InputStream is,
                        java.io.OutputStream os)
Create an instance on a couple of paired streams.

Parameters:
is - the stream on which the telnet input is read
os - the stream on which the telnet output is written