|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object examples.TelnetClientExample
public class TelnetClientExample
This is a simple example of use of TelnetClient. An external option handler (SimpleTelnetOptionHandler) is used. Initial configuration requested by TelnetClient will be: WILL ECHO, WILL SUPPRESS-GA, DO SUPPRESS-GA. VT100 terminal type will be subnegotiated.
Also, use of the sendAYT(), getLocalOptionState(), getRemoteOptionState() is demonstrated. When connected, type AYT to send an AYT command to the server and see the result. Type OPT to see a report of the state of the first 25 options.
Field Summary |
---|
Fields inherited from interface org.apache.commons.net.telnet.TelnetNotificationHandler |
---|
RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT |
Constructor Summary | |
---|---|
TelnetClientExample()
|
Method Summary | |
---|---|
static void |
main(String[] args)
Main for the TelnetClientExample. |
void |
receivedNegotiation(int negotiation_code,
int option_code)
Callback method called when TelnetClient receives an option negotiation command. |
void |
run()
Reader thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TelnetClientExample()
Method Detail |
---|
public static void main(String[] args) throws IOException
IOException
public void receivedNegotiation(int negotiation_code, int option_code)
receivedNegotiation
in interface TelnetNotificationHandler
negotiation_code
- - type of negotiation command received
(RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT)
option_code
- - code of the option negotiated
public void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |