Java 类io.netty.handler.timeout.TimeoutException 实例源码

项目:candlelight    文件:NetworkDispatcher.java   
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
{
    String msg;

    if (cause instanceof TimeoutException)
    {
        msg = "timeout";
    }
    else
    {
        msg = "unknown";
    }

    this.closeChannel(msg);
}
项目:fresco_floodlight    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:SDN-Multicast    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:arscheduler    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:floodlight1.2-delay    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:floodlight-hardware    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:ACAMPController    文件:BootstrapClient.java   
public void shutdown() {
     if (cg != null) {
         cg.close().awaitUninterruptibly();
         cg = null;
     }
     bootstrap = null;
     pipelineFactory = null;
     if (workerExecutor != null) {
         try {
    workerExecutor.shutdownGracefully();
} catch (TimeoutException e) {
    logger.warn("Error waiting for gracefull shutdown of BootstrapClient {}", e);
}
         workerExecutor = null;
     }
     if (timer != null) {
        timer.stop();
        timer = null;
     }
 }
项目:LanternServer    文件:NetworkSession.java   
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
    // Pipeline error, just log it
    if (cause instanceof CodecException) {
        Lantern.getLogger().error("A netty pipeline error occurred", cause);
    } else {
        if (cause instanceof IOException) {
            final StackTraceElement[] stack = cause.getStackTrace();
            if (stack.length != 0 && stack[0].toString().startsWith("sun.nio.ch.SocketDispatcher.read0")) {
                return;
            }
        }

        // Use the debug level, don't spam the server with errors
        // caused by client disconnection, ...
        Lantern.getLogger().debug("A netty connection error occurred", cause);

        if (cause instanceof TimeoutException) {
            closeChannel(t("disconnect.timeout"));
        } else {
            closeChannel(t("disconnect.genericReason", "Internal Exception: " + cause));
        }
    }
}
项目:ExpandedRailsMod    文件:NetworkManager.java   
public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_) throws Exception
{
    TextComponentTranslation textcomponenttranslation;

    if (p_exceptionCaught_2_ instanceof TimeoutException)
    {
        textcomponenttranslation = new TextComponentTranslation("disconnect.timeout", new Object[0]);
    }
    else
    {
        textcomponenttranslation = new TextComponentTranslation("disconnect.genericReason", new Object[] {"Internal Exception: " + p_exceptionCaught_2_});
    }

    LOGGER.debug((Object)p_exceptionCaught_2_);
    this.closeChannel(textcomponenttranslation);
}
项目:aliyun-oss-hadoop-fs    文件:TestDtpHttp2.java   
@BeforeClass
public static void setUp() throws IOException, URISyntaxException,
    TimeoutException {
  CLUSTER = new MiniDFSCluster.Builder(CONF).numDataNodes(1).build();
  CLUSTER.waitActive();

  RESPONSE_HANDLER = new Http2ResponseHandler();
  Bootstrap bootstrap =
      new Bootstrap()
          .group(WORKER_GROUP)
          .channel(NioSocketChannel.class)
          .remoteAddress("127.0.0.1",
            CLUSTER.getDataNodes().get(0).getInfoPort())
          .handler(new ChannelInitializer<Channel>() {

            @Override
            protected void initChannel(Channel ch) throws Exception {
              Http2Connection connection = new DefaultHttp2Connection(false);
              Http2ConnectionHandler connectionHandler =
                  new HttpToHttp2ConnectionHandler(connection, frameReader(),
                      frameWriter(), new DelegatingDecompressorFrameListener(
                          connection, new InboundHttp2ToHttpAdapter.Builder(
                              connection).maxContentLength(Integer.MAX_VALUE)
                              .propagateSettings(true).build()));
              ch.pipeline().addLast(connectionHandler, RESPONSE_HANDLER);
            }
          });
  CHANNEL = bootstrap.connect().syncUninterruptibly().channel();

}
项目:Apex    文件:SocketDownstreamHandler.java   
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {

    ChannelUtil.closeOnFlush(ctx.channel());

    // Ignore IO and timeout related exceptions
    if (!(cause instanceof IOException) && !(cause instanceof TimeoutException)) {
        logger.error(cause.getMessage(), cause);
    }
}
项目:Apex    文件:SocketUpstreamHandler.java   
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {

    ChannelUtil.closeOnFlush(ctx.channel());

    // Ignore IO and timeout related exceptions
    if (!(cause instanceof IOException) && !(cause instanceof TimeoutException)) {
        logger.error(cause.getMessage(), cause);
    }
}
项目:Cauldron    文件:NetworkManager.java   
public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_)
{
    ChatComponentTranslation chatcomponenttranslation;

    if (p_exceptionCaught_2_ instanceof TimeoutException)
    {
        chatcomponenttranslation = new ChatComponentTranslation("disconnect.timeout", new Object[0]);
    }
    else
    {
        chatcomponenttranslation = new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Internal Exception: " + p_exceptionCaught_2_});
    }

    this.closeChannel(chatcomponenttranslation);
}
项目:Cauldron    文件:NetworkManager.java   
public void exceptionCaught(ChannelHandlerContext p_exceptionCaught_1_, Throwable p_exceptionCaught_2_)
{
    ChatComponentTranslation chatcomponenttranslation;

    if (p_exceptionCaught_2_ instanceof TimeoutException)
    {
        chatcomponenttranslation = new ChatComponentTranslation("disconnect.timeout", new Object[0]);
    }
    else
    {
        chatcomponenttranslation = new ChatComponentTranslation("disconnect.genericReason", new Object[] {"Internal Exception: " + p_exceptionCaught_2_});
    }

    this.closeChannel(chatcomponenttranslation);
}
项目:SpigotSource    文件:NetworkManager.java   
public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) throws Exception {
    ChatMessage chatmessage;

    if (throwable instanceof TimeoutException) {
        chatmessage = new ChatMessage("disconnect.timeout", new Object[0]);
    } else {
        chatmessage = new ChatMessage("disconnect.genericReason", new Object[] { "Internal Exception: " + throwable});
    }

    NetworkManager.g.debug(throwable);
    this.close(chatmessage);
    if (MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot
}