Codota Logo
ChannelHandlerContext.flush
Code IndexAdd Codota to your IDE (free)

How to use
flush
method
in
io.netty.channel.ChannelHandlerContext

Best Java code snippets using io.netty.channel.ChannelHandlerContext.flush (Showing top 20 results out of 2,025)

  • Common ways to obtain ChannelHandlerContext
private void myMethod () {
ChannelHandlerContext c =
  • Codota IconMockito mockito;mockito.mock(ChannelHandlerContext.class)
  • Smart code suggestions by Codota
}
origin: netty/netty

@Override
public ChannelHandlerContext flush() {
  ctx.flush();
  return this;
}
origin: netty/netty

  /**
   * 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();
  }
}
origin: netty/netty

  /**
   * 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();
  }
}
origin: eclipse-vertx/vert.x

@Override
public ChannelHandlerContext flush() {
 ctx.flush();
 return this;
}
origin: eclipse-vertx/vert.x

protected synchronized final void endReadAndFlush() {
 if (read) {
  read = false;
  if (needsFlush && writeInProgress == 0) {
   needsFlush = false;
   chctx.flush();
  }
 }
}
origin: redisson/redisson

  /**
   * 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();
  }
}
origin: redisson/redisson

@Override
public ChannelHandlerContext flush() {
  ctx.flush();
  return this;
}
origin: redisson/redisson

  @Override
  public void run() {
    if (flushPendingCount > 0 && !readInProgress) {
      flushPendingCount = 0;
      ctx.flush();
      nextScheduledFlush = null;
    } // else we'll flush when the read completes
  }
}
origin: redisson/redisson

  @Override
  public void flush(ChannelHandlerContext ctx) throws Exception {
    ctx.flush();
  }
}
origin: eclipse-vertx/vert.x

@Override
public synchronized void close() {
 // Close after all data is written
 chctx.write(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
 chctx.flush();
}
origin: eclipse-vertx/vert.x

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();
}
origin: eclipse-vertx/vert.x

@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();
 }
}

origin: netty/netty

@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();
}
origin: eclipse-vertx/vert.x

@Override
public void reset(long code) {
 /*
 if (!handleEnded(true)) {
  throw new IllegalStateException("Response has already been written");
 }
 */
 checkEnded();
 stream.writeReset(code);
 ctx.flush();
}
origin: eclipse-vertx/vert.x

private void _writeSettings(Http2Settings settingsUpdate, ChannelPromise promise) {
 encoder().writeSettings(chctx, settingsUpdate, promise);
 chctx.flush();
}
origin: redisson/redisson

@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();
}
origin: eclipse-vertx/vert.x

@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();
 }
}
origin: eclipse-vertx/vert.x

private void _writeGoAway(long errorCode, int lastStreamId, ByteBuf debugData) {
 encoder().writeGoAway(chctx, lastStreamId, errorCode, debugData, chctx.newPromise());
 chctx.flush();
}
origin: eclipse-vertx/vert.x

@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;
 }
}
origin: eclipse-vertx/vert.x

@Override
public HttpServerResponse writeContinue() {
 synchronized (conn) {
  checkHeadWritten();
  stream.writeHeaders(new DefaultHttp2Headers().status("100"), false);
  ctx.flush();
  return this;
 }
}
io.netty.channelChannelHandlerContextflush

Popular methods of ChannelHandlerContext

  • channel
    Return the Channel which is bound to the ChannelHandlerContext.
  • close
  • writeAndFlush
  • write
  • fireChannelRead
  • pipeline
    Return the assigned ChannelPipeline
  • alloc
    Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
  • executor
    Returns the EventExecutor which is used to execute an arbitrary task.
  • fireExceptionCaught
  • fireUserEventTriggered
  • newPromise
  • fireChannelActive
  • newPromise,
  • fireChannelActive,
  • fireChannelInactive,
  • voidPromise,
  • read,
  • fireChannelReadComplete,
  • name,
  • attr,
  • disconnect

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now