@Override protected void complete() throws IOException { super.complete(); if (completionListener != null) { ChannelListeners.invokeChannelListener(this, completionListener); } }
public Http2Channel getHttp2Channel() { return getFramedChannel(); }
@Override protected void closeSubChannels() { for (Map.Entry<Integer, StreamHolder> e : currentStreams.entrySet()) { StreamHolder holder = e.getValue(); AbstractHttp2StreamSourceChannel receiver = holder.sourceChannel; if(receiver != null) { receiver.markStreamBroken(); } Http2StreamSinkChannel sink = holder.sinkChannel; if(sink != null) { if (sink.isWritesShutdown()) { ChannelListeners.invokeChannelListener(sink.getIoThread(), sink, ((ChannelListener.SimpleSetter) sink.getWriteSetter()).get()); } IoUtils.safeClose(sink); } } }
@Override public long read(ByteBuffer[] dsts, int offset, int length) throws IOException { long read = super.read(dsts, offset, length); updateFlowControlWindow((int) read); return read; }
@Override public long transferTo(long position, long count, FileChannel target) throws IOException { long read = super.transferTo(position, count, target); updateFlowControlWindow((int) read); return read; }
void rstStream() { rstStream(Http2Channel.ERROR_CANCEL); }
result.addCloseTask(new ChannelListener<AbstractHttp2StreamSourceChannel>() { @Override public void handleEvent(AbstractHttp2StreamSourceChannel channel) {
@Override public int read(ByteBuffer dst) throws IOException { int read = super.read(dst); updateFlowControlWindow(read); return read; }
@Override public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel streamSinkChannel) throws IOException { long read = super.transferTo(count, throughBuffer, streamSinkChannel); updateFlowControlWindow((int) read + throughBuffer.remaining()); return read; }
void rstStream() { rstStream(Http2Channel.ERROR_CANCEL); }
result.addCloseTask(new ChannelListener<AbstractHttp2StreamSourceChannel>() { @Override public void handleEvent(AbstractHttp2StreamSourceChannel channel) {
@Override public long read(ByteBuffer[] dsts) throws IOException { long read = super.read(dsts); updateFlowControlWindow((int) read); return read; }
@Override public long transferTo(long count, ByteBuffer throughBuffer, StreamSinkChannel streamSinkChannel) throws IOException { long read = super.transferTo(count, throughBuffer, streamSinkChannel); updateFlowControlWindow((int) read + throughBuffer.remaining()); return read; }
@Override protected void complete() throws IOException { super.complete(); if (completionListener != null) { ChannelListeners.invokeChannelListener(this, completionListener); } }
void rstStream() { rstStream(Http2Channel.ERROR_CANCEL); }
public Http2Channel getHttp2Channel() { return getFramedChannel(); }
@Override protected void closeSubChannels() { for (Map.Entry<Integer, StreamHolder> e : currentStreams.entrySet()) { StreamHolder holder = e.getValue(); AbstractHttp2StreamSourceChannel receiver = holder.sourceChannel; if(receiver != null) { receiver.markStreamBroken(); } Http2StreamSinkChannel sink = holder.sinkChannel; if(sink != null) { if (sink.isWritesShutdown()) { ChannelListeners.invokeChannelListener(sink.getIoThread(), sink, ((ChannelListener.SimpleSetter) sink.getWriteSetter()).get()); } IoUtils.safeClose(sink); } } }