本文整理汇总了Java中org.apache.commons.net.telnet.InvalidTelnetOptionException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidTelnetOptionException类的具体用法?Java InvalidTelnetOptionException怎么用?Java InvalidTelnetOptionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InvalidTelnetOptionException类属于org.apache.commons.net.telnet包,在下文中一共展示了InvalidTelnetOptionException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import org.apache.commons.net.telnet.InvalidTelnetOptionException; //导入依赖的package包/类
public void open(String host, int port) throws IOException {
// Synchronized block prevents listener thread from attempting to read input before we're ready.
synchronized (this.charBuffer) {
this.telnetClient.connect(host, port);
this.telnetClient.setKeepAlive(true);
if (this.suppressGAOptionHandler == null) {
// Only do this once.
this.suppressGAOptionHandler = new SuppressGAOptionHandler(true, true, true, true);
try {
this.telnetClient.addOptionHandler(this.suppressGAOptionHandler);
} catch (InvalidTelnetOptionException e) {
// Should never happen. Wrap it inside IOException so as not to declare another throwable.
throw new IOException(e);
}
}
this.reader = new BufferedReader(new InputStreamReader(this.telnetClient.getInputStream()));
this.outstream = new PrintStream(this.telnetClient.getOutputStream());
}
}
示例2: setOptionHandler
import org.apache.commons.net.telnet.InvalidTelnetOptionException; //导入依赖的package包/类
public void setOptionHandler(TelnetOptionHandler handler) throws IOException, InvalidTelnetOptionException {
checkNotConnected();
client.addOptionHandler(handler);
}