public class TelnetClientExample extends java.lang.Object implements java.lang.Runnable, TelnetNotificationHandler
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.
Modifier and Type | Field and Description |
---|---|
(package private) static TelnetClient |
tc |
RECEIVED_COMMAND, RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT
Constructor and Description |
---|
TelnetClientExample() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.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.
|
static TelnetClient tc
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- input paramsjava.lang.Exception
- on errorpublic 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, RECEIVED_COMMAND)option_code
- - code of the option negotiatedpublic void run()
run
in interface java.lang.Runnable