@Override public void failed(Throwable x) { cancelTask(); notifyCallbackFailed(callback, x); } }
@Override public void run() { close(); failed(new InterruptedByTimeoutException()); }
@Override public int compareTo(FrameBytes that) { // FrameBytes may have or not have a related stream (for example, PING do not have a related stream) // FrameBytes without related streams have higher priority IStream thisStream = getStream(); IStream thatStream = that.getStream(); if (thisStream == null) return thatStream == null ? 0 : -1; if (thatStream == null) return 1; // If this.stream.priority > that.stream.priority => this.stream has less priority than that.stream return thatStream.getPriority() - thisStream.getPriority(); }
@Override public void succeeded() { bufferPool.release(buffer); IStream stream = getStream(); dataInfo.consume(size); flowControlStrategy.updateWindow(StandardSession.this, stream, -size); if (dataInfo.available() > 0) { // We have written a frame out of this DataInfo, but there is more to write. // We need to keep the correct ordering of frames, to avoid that another // DataInfo for the same stream is written before this one is finished. flush(this, flusher.prepend(this)); } else { super.succeeded(); stream.updateCloseState(dataInfo.isClose(), true); if (stream.isClosed()) removeStream(stream); } }
@Override public void succeeded() { bufferPool.release(buffer); super.succeeded(); if (frame.getType() == ControlFrameType.GO_AWAY) { // After sending a GO_AWAY we need to hard close the connection. // Recipients will know the last good stream id and act accordingly. close(); } IStream stream = getStream(); if (stream != null && stream.isClosed()) removeStream(stream); }
@Override public void succeeded() { cancelTask(); StandardSession.this.complete(callback); }
@Override public void succeeded() { super.succeeded(); close(); } }