mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-07 15:50:57 +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();
|
super.notifyDisconnect();
|
||||||
FutureUtils.alertAll(new ConnectionException("Disconnected."), globalReqFutures);
|
FutureUtils.alertAll(new ConnectionException("Disconnected."), globalReqFutures);
|
||||||
for (Channel chan : channels.values())
|
for (Channel chan : channels.values())
|
||||||
chan.close();
|
chan.finishOff();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -302,8 +302,8 @@ public abstract class AbstractChannel
|
|||||||
rwin.expand(howMuch);
|
rwin.expand(howMuch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when this channel's end-of-life has been reached. Subclasses may override but must call super. */
|
@Override
|
||||||
protected void finishOff() {
|
public void finishOff() {
|
||||||
conn.forget(this);
|
conn.forget(this);
|
||||||
close.set();
|
close.set();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ public interface Channel
|
|||||||
/** @return whether the channel is open. */
|
/** @return whether the channel is open. */
|
||||||
boolean isOpen();
|
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
|
* 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.
|
* OutputStream} for this channel will be closed and no longer usable.
|
||||||
|
|||||||
Reference in New Issue
Block a user