Accepting options |
The telnet server may request that an option be used by sending a DO OPTION (or WILL OPTION) command where OPTION is the option code for the requested option. The client may accept the option by returning a WILL OPTION (or DO OPTION) command.
To capture and accept these options the TelnetListener#doOption and TelnetListener#willOption methods must be overloaded. To accept these option requests the Telnet#sendDoOption and Telnet#sendWillOption methods are used respectively.
Example
public void doOption(DoOptionEvent event) { TelnetOption option = event.getOption(); telnet.sendWillOption(option); }
public void willOption(WillOptionEvent event) { TelnetOption option = event.getOption(); telnet.sendDoOption(option); } |