in ConnectionImpl#notifyDisconnect() -- why try to close channels politely, they should just be discarded

This commit is contained in:
Shikhar Bhushan
2010-07-20 23:48:05 +01:00
parent 8b21eff1d2
commit fb97ccb67c
3 changed files with 6 additions and 3 deletions

View File

@@ -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();
} }
} }

View File

@@ -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();
} }

View File

@@ -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.