congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ChannelHandlerContext.close
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using io.netty.channel.ChannelHandlerContext.close (Showing top 20 results out of 4,248)

Refine searchRefine arrow

  • ChannelHandlerContext.channel
origin: alibaba/fescar

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  ctx.close();
  LOGGER.info("channel error for ClientProxyHandler at :[{}]",ctx.channel());
}
origin: redisson/redisson

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    logger.warn("{} Failed to select the application-level protocol:", ctx.channel(), cause);
    ctx.close();
  }
}
origin: redisson/redisson

/**
 * Invoked on failed initial SSL/TLS handshake.
 */
protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
  ctx.close();
}
origin: neo4j/neo4j

@Override
public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause )
{
  log.error( "Fatal error occurred during protocol handshaking: " + ctx.channel(), cause );
  ctx.close();
}
origin: jamesdbloom/mockserver

@Override
public void channelRead0(ChannelHandlerContext ctx, HttpResponse response) {
  ctx.channel().attr(RESPONSE_FUTURE).get().set(response);
  ctx.close();
}
origin: netty/netty

/**
 * Handle the {@link Throwable} by logging and closing the {@link Channel}. Sub-classes may override this.
 */
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (logger.isWarnEnabled()) {
    logger.warn("Failed to initialize a channel. Closing: " + ctx.channel(), cause);
  }
  ctx.close();
}
origin: alibaba/fescar

private void closeChannelHandlerContext(ChannelHandlerContext ctx) {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("closeChannelHandlerContext channel:" + ctx.channel());
  }
  ctx.disconnect();
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: wildfly/wildfly

/**
 * Invoked on failed initial SSL/TLS handshake.
 */
protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
  ctx.close();
}
origin: wildfly/wildfly

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    logger.warn("{} Failed to select the application-level protocol:", ctx.channel(), cause);
    ctx.close();
  }
}
origin: wildfly/wildfly

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (cause instanceof WebSocketHandshakeException) {
    FullHttpResponse response = new DefaultFullHttpResponse(
        HTTP_1_1, HttpResponseStatus.BAD_REQUEST, Unpooled.wrappedBuffer(cause.getMessage().getBytes()));
    ctx.channel().writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
  } else {
    ctx.fireExceptionCaught(cause);
    ctx.close();
  }
}
origin: jamesdbloom/mockserver

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
  if (isNotSslException(cause)) {
    cause.printStackTrace();
  }
  ctx.channel().attr(RESPONSE_FUTURE).get().setException(cause);
  ctx.close();
}
origin: line/armeria

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    if (handshakeFailed &&
      cause instanceof DecoderException &&
      cause.getCause() instanceof SSLException) {
      // Swallow an SSLException raised after handshake failure.
      return;
    }
    Exceptions.logIfUnexpected(logger, ctx.channel(), cause);
    ctx.close();
  }
});
origin: line/armeria

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    Exceptions.logIfUnexpected(logger, ctx.channel(), cause);
    ctx.close();
  }
}
origin: line/armeria

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Exceptions.logIfUnexpected(logger, ctx.channel(), protocol, cause);
  if (ctx.channel().isActive()) {
    ctx.close();
  }
}
origin: redisson/redisson

/**
 * Handle the {@link Throwable} by logging and closing the {@link Channel}. Sub-classes may override this.
 */
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (logger.isWarnEnabled()) {
    logger.warn("Failed to initialize a channel. Closing: " + ctx.channel(), cause);
  }
  ctx.close();
}
origin: aws/aws-sdk-java

@Override
public void channelRead0(final ChannelHandlerContext ctx, final AckEvent msg) {
  if (msg instanceof FinalAckEvent) {
    ctx.channel().attr(ChannelAttributeKeys.FINAL_ACK_RECEIVED).set(Boolean.TRUE);
    responseHandler.onComplete();
    ctx.close();
  } else {
    responseHandler.onAckEvent(msg);
  }
}
origin: jamesdbloom/mockserver

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
    mockServerLogger.error("web socket client caught exception", cause);
    final SettableFuture<String> registrationFuture = ctx.channel().attr(REGISTRATION_FUTURE).get();
    if (!registrationFuture.isDone()) {
      registrationFuture.setException(cause);
    }
    ctx.close();
  }
}
io.netty.channelChannelHandlerContextclose

Popular methods of ChannelHandlerContext

  • channel
    Return the Channel which is bound to the ChannelHandlerContext.
  • writeAndFlush
  • write
  • flush
  • 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
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now