Class socket.TelnetIO
All Packages Class Hierarchy This Package Previous Next Index
Class socket.TelnetIO
java.lang.Object
|
+----socket.TelnetIO
- public class TelnetIO
- extends Object
- implements StatusPeer
Implements simple telnet io
- Version:
- $Id: TelnetIO.java,v 1.10 1998/02/09 10:22:18 leo Exp $
- Author:
- Matthias L. Jugel, Marcus Meißner
-
TelnetIO()
-
-
available()
- Returns bytes available to be read.
-
connect(String)
- Connect to the remote host at the default telnet port (23).
-
connect(String, int)
- Connect to the remote host at the specified port.
-
disconnect()
- Disconnect from remote host.
-
notifyStatus(Vector)
- Notify about current telnet status.
-
receive()
- Read data from the remote host.
-
send(byte)
-
-
send(byte[])
- Send data to the remote host.
-
setPeer(StatusPeer)
- Set the object to be notified about current status.
-
toString()
- Return the version of TelnetIO.
TelnetIO
public TelnetIO()
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
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
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.
- Parameters:
- status - contains status information
All Packages Class Hierarchy This Package Previous Next Index