402075 Cancel idle timeouts on close

This commit is contained in:
Greg Wilkins 2013-03-01 14:09:04 +11:00
parent 0ed3638660
commit 718ee4ddeb
2 changed files with 9 additions and 0 deletions

View File

@ -100,6 +100,7 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
@Override
public void onClose()
{
super.onClose();
LOG.debug("onClose {}",this);
_writeFlusher.onClose();
_fillInterest.onClose();

View File

@ -95,6 +95,7 @@ public abstract class IdleTimeout
// If we have a new timeout, then check and reschedule
if (idleTimeout>0 && isOpen())
_idleTask.run();
}
/** This method should be called when non-idle activity has taken place.
@ -119,6 +120,13 @@ public abstract class IdleTimeout
if (_idleTimeout>0)
_idleTask.run();
}
public void onClose()
{
Scheduler.Task oldTimeout = _timeout.getAndSet(null);
if (oldTimeout != null)
oldTimeout.cancel();
}
protected void close()
{