/** * Calls {@link ChannelHandlerContext#flush()} to forward * to the next {@link ChannelOutboundHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void flush(ChannelHandlerContext ctx) throws Exception { ctx.flush(); } }
@Override public ChannelHandlerContext flush() { ctx.flush(); return this; }
/** * Calls {@link ChannelHandlerContext#flush()} to forward * to the next {@link ChannelOutboundHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void flush(ChannelHandlerContext ctx) throws Exception { ctx.flush(); } }
protected synchronized final void endReadAndFlush() { if (read) { read = false; if (needsFlush && writeInProgress == 0) { needsFlush = false; chctx.flush(); } } }
@Override public ChannelHandlerContext flush() { ctx.flush(); return this; }
@Override public ChannelHandlerContext flush() { ctx.flush(); return this; }
@Override public void run() { if (flushPendingCount > 0 && !readInProgress) { flushPendingCount = 0; ctx.flush(); nextScheduledFlush = null; } // else we'll flush when the read completes } }
/** * Calls {@link ChannelHandlerContext#flush()} to forward * to the next {@link ChannelOutboundHandler} in the {@link ChannelPipeline}. * * Sub-classes may override this method to change behavior. */ @Override public void flush(ChannelHandlerContext ctx) throws Exception { ctx.flush(); } }
@Override public void flush(ChannelHandlerContext ctx) throws Exception { ctx.flush(); } }
@Override public synchronized void close() { // Close after all data is written chctx.write(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE); chctx.flush(); }
public void clientUpgrade(ChannelHandlerContext ctx) throws Exception { onHttpClientUpgrade(); // super call writes the connection preface // we need to flush to send it // this is called only on the client ctx.flush(); }
@Override public void writeBuffer(ByteBuf buf, boolean end) { if (buf == null && end) { buf = Unpooled.EMPTY_BUFFER; } if (buf != null) { writeData(buf, end); } if (end) { handlerContext.flush(); } }
@Override public void flush(final ChannelHandlerContext ctx) throws Exception { if (buffer != null && buffer.isReadable()) { final ByteBuf buf = allocateBuffer(ctx, Unpooled.EMPTY_BUFFER, isPreferDirect(), false); flushBufferedData(buf); ctx.write(buf); } ctx.flush(); }
@Override public void reset(long code) { /* if (!handleEnded(true)) { throw new IllegalStateException("Response has already been written"); } */ checkEnded(); stream.writeReset(code); ctx.flush(); }
private void _writeSettings(Http2Settings settingsUpdate, ChannelPromise promise) { encoder().writeSettings(chctx, settingsUpdate, promise); chctx.flush(); }
@Override public void flush(final ChannelHandlerContext ctx) throws Exception { if (buffer != null && buffer.isReadable()) { final ByteBuf buf = allocateBuffer(ctx, Unpooled.EMPTY_BUFFER, isPreferDirect(), false); flushBufferedData(buf); ctx.write(buf); } ctx.flush(); }
@Override protected void doWrite(ChannelOutboundBuffer in) throws Exception { ByteBuf chunk; while (!stream.isNotWritable() && (chunk = (ByteBuf) in.current()) != null) { bytesWritten += chunk.readableBytes(); stream.writeData(chunk.retain(), false); stream.handlerContext.flush(); in.remove(); } }
private void _writeGoAway(long errorCode, int lastStreamId, ByteBuf debugData) { encoder().writeGoAway(chctx, lastStreamId, errorCode, debugData, chctx.newPromise()); chctx.flush(); }
@Override public HttpServerResponse writeCustomFrame(int type, int flags, Buffer payload) { synchronized (conn) { checkEnded(); checkSendHeaders(false); stream.writeFrame(type, flags, payload.getByteBuf()); ctx.flush(); return this; } }
@Override public HttpServerResponse writeContinue() { synchronized (conn) { checkHeadWritten(); stream.writeHeaders(new DefaultHttp2Headers().status("100"), false); ctx.flush(); return this; } }