You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggest replacing the existing close() method with the following:
/**
* The OutputStream passed to Expect constructor is closed; the InputStream
* is not closed (there is no need to close the InputStream).<br>
* It is suggested that this method be called after the InputStream has come
* to EOF. For example, when you connect through SSH, send an "exit" command
* first, and then call this method.<br>
* <br>
*
* When this method is called, the thread which write to the sink of the
* pipe will end.
*/
public void close() {
try {
this.output.close();
} catch (IOException e) {
log.warn("Exception when closing OutputStream", e);
//e.printStackTrace();
}
try {
this.inputChannel.close();
} catch (IOException e) {
log.warn("Exception when closing input Channel", e);
//e.printStackTrace();
}
try {
this.selector.close();
} catch (IOException e) {
log.warn("Exception when closing selector", e);
}
}
The Selecotr that is opened on line 64 in never closed. This will eventually cause a "Too many files open" Exception.
The text was updated successfully, but these errors were encountered: