Open SiteSearch 4.1.1
Final

ORG.oclc.Telnet.socket
Class TelnetIO

java.lang.Object
  |
  +--ORG.oclc.Telnet.socket.TelnetIO

public class TelnetIO
extends Object
implements StatusPeer

Implements simple telnet io


Constructor Summary
TelnetIO()
           
 
Method Summary
 int available()
          Returns bytes available to be read.
 void connect(String address)
          Connect to the remote host at the default telnet port (23).
 void connect(String address, int port)
          Connect to the remote host at the specified port.
 void disconnect()
          Disconnect from remote host.
 Object notifyStatus(Vector status)
          Notify about current telnet status.
 byte[] receive()
          Read data from the remote host.
 void send(byte b)
           
 void send(byte[] buf)
          Send data to the remote host.
 void setPeer(StatusPeer obj)
          Set the object to be notified about current status.
 String toString()
          Return the version of TelnetIO.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TelnetIO

public TelnetIO()
Method Detail

toString

public String toString()
Return the version of TelnetIO.
Overrides:
toString in class Object

connect

public void connect(String address,
                    int port)
             throws IOException
Connect to the remote host at the specified port.
Parameters:
address - the symbolic host address
port - the numeric port
See Also:
disconnect()

disconnect

public void disconnect()
                throws IOException
Disconnect from remote host.
See Also:
connect(java.lang.String, int)

connect

public void connect(String address)
             throws IOException
Connect to the remote host at the default telnet port (23).
Parameters:
address - the symbolic host address

setPeer

public void setPeer(StatusPeer obj)
Set the object to be notified about current status.
Parameters:
obj - object to be notified.

available

public int available()
              throws IOException
Returns bytes available to be read. Since they haven't been negotiated over, this could be misleading. Most useful as a boolean value - "are any bytes available" - rather than as an exact count of "how many ara available."
Throws:
IOException - on problems with the socket connection

receive

public byte[] receive()
               throws IOException
Read data from the remote host. Blocks until data is available. Returns an array of bytes.
See Also:
send(byte[])

send

public void send(byte[] buf)
          throws IOException
Send data to the remote host.
Parameters:
buf - array of bytes to send
See Also:
receive()

send

public void send(byte b)
          throws IOException

notifyStatus

public Object notifyStatus(Vector status)
Notify about current telnet status. This method is called top-down.
Specified by:
notifyStatus in interface StatusPeer
Parameters:
status - contains status information

Open SiteSearch 4.1.1
Final