mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 15:20:54 +03:00
in ConnectionImpl#notifyDisconnect() -- why try to close channels politely, they should just be discarded
This commit is contained in:
@@ -250,7 +250,7 @@ public class ConnectionImpl
|
||||
super.notifyDisconnect();
|
||||
FutureUtils.alertAll(new ConnectionException("Disconnected."), globalReqFutures);
|
||||
for (Channel chan : channels.values())
|
||||
chan.close();
|
||||
chan.finishOff();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -302,8 +302,8 @@ public abstract class AbstractChannel
|
||||
rwin.expand(howMuch);
|
||||
}
|
||||
|
||||
/** Called when this channel's end-of-life has been reached. Subclasses may override but must call super. */
|
||||
protected void finishOff() {
|
||||
@Override
|
||||
public void finishOff() {
|
||||
conn.forget(this);
|
||||
close.set();
|
||||
}
|
||||
|
||||
@@ -117,6 +117,9 @@ public interface Channel
|
||||
/** @return whether the channel is open. */
|
||||
boolean isOpen();
|
||||
|
||||
/** Called when this channel's end-of-life has been reached. Subclasses may override but must call super. */
|
||||
void finishOff();
|
||||
|
||||
/**
|
||||
* Sends an EOF message to the server for this channel; indicating that no more data will be sent by us. The {@code
|
||||
* OutputStream} for this channel will be closed and no longer usable.
|
||||
|
||||
Reference in New Issue
Block a user