|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.net.SocketClient | +--org.apache.commons.net.telnet.Telnet | +--org.apache.commons.net.telnet.TelnetClient
The TelnetClient class implements the simple network virtual terminal (NVT) for the Telnet protocol according to RFC 854. It does not implement any of the extra Telnet options because it is meant to be used within a Java program providing automated access to Telnet accessible resources.
The class can be used by first connecting to a server using the SocketClient connect method. Then an InputStream and OutputStream for sending and receiving data over the Telnet connection can be obtained by using the getInputStream() and getOutputStream() methods. When you finish using the streams, you must call disconnect rather than simply closing the streams.
Field Summary |
Fields inherited from class org.apache.commons.net.SocketClient |
_defaultPort_, _input_, _isConnected_, _output_, _socket_, _socketFactory_, _timeout_, NETASCII_EOL |
Constructor Summary | |
TelnetClient()
Default TelnetClient constructor. |
Method Summary | |
protected void |
_connectAction_()
Handles special connection requirements. |
void |
disconnect()
Disconnects the telnet session, closing the input and output streams as well as the socket. |
java.io.InputStream |
getInputStream()
Returns the telnet connection input stream. |
java.io.OutputStream |
getOutputStream()
Returns the telnet connection output stream. |
Methods inherited from class org.apache.commons.net.SocketClient |
connect, connect, connect, connect, connect, connect, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setDefaultPort, setDefaultTimeout, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TelnetClient()
Method Detail |
protected void _connectAction_() throws java.io.IOException
_connectAction_
in class org.apache.commons.net.telnet.Telnet
java.io.IOException
- If an error occurs during connection setup.public void disconnect() throws java.io.IOException
disconnect
in class SocketClient
java.io.IOException
- If there is an error closing the socket.public java.io.OutputStream getOutputStream()
public java.io.InputStream getInputStream()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |