@Override public void endStream(final List<? extends Header> trailers) throws IOException { ioSession.getLock().lock(); try { if (localEndStream) { return; } localEndStream = true; if (trailers != null && !trailers.isEmpty()) { commitHeaders(id, trailers, true); } else { final RawFrame frame = frameFactory.createData(id, null, true); commitFrameInternal(frame); } } finally { ioSession.getLock().unlock(); } }
private void streamDataFrame( final int streamId, final AtomicInteger streamOutputWindow, final ByteBuffer payload, final int chunk) throws IOException { final RawFrame dataFrame = frameFactory.createData(streamId, payload, false); if (streamListener != null) { streamListener.onFrameOutput(this, streamId, dataFrame); } updateOutputWindow(0, connOutputWindow, -chunk); updateOutputWindow(streamId, streamOutputWindow, -chunk); outputBuffer.write(dataFrame, ioSession.channel()); }