当前位置: 首页>>代码示例>>Java>>正文


Java IdleState.ALL_IDLE属性代码示例

本文整理汇总了Java中org.jboss.netty.handler.timeout.IdleState.ALL_IDLE属性的典型用法代码示例。如果您正苦于以下问题:Java IdleState.ALL_IDLE属性的具体用法?Java IdleState.ALL_IDLE怎么用?Java IdleState.ALL_IDLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.jboss.netty.handler.timeout.IdleState的用法示例。


在下文中一共展示了IdleState.ALL_IDLE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: channelIdle

@Override
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e)
    throws Exception {
  if (e.getState() == IdleState.ALL_IDLE) {
    e.getChannel().close();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:RpcProgramPortmap.java

示例2: channelIdle

@Override
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception {
	 super.channelIdle(ctx, e);  

	 if(e.getState() == IdleState.ALL_IDLE) {
		 e.getChannel().close();
		 System.out.println("idle channel was closed!");
	 }
   }
 
开发者ID:tangaiyun,项目名称:Netty-Resteasy-Spring,代码行数:9,代码来源:HealthCheckHandler.java

示例3: channelIdle

@Override
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) {
    logger.info("In IDLE event handler for TCP...");
    
    //there are 3 states. READER/WRITER/ALL
    if (e.getState() == IdleState.ALL_IDLE){
        int statusCodeInt = 0;
        String statusCode = statusCodeInt + " SUCCESSFUL";
        String errMsg="idleTimeout to finish";
        
        tcpWorker.onComplete(tcpWorker.responseSb.toString(), false, 
                errMsg, errMsg, statusCode, statusCodeInt);
    }
}
 
开发者ID:eBay,项目名称:parallec,代码行数:14,代码来源:TcpWorker.java

示例4: channelIdle

/**
 * this case is like a read timeout where did not get anything from the
 * server for a long time.
 * 
 * For UDP need to mark as error
 * 
 * @see org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler#channelIdle
 *      (org.jboss.netty.channel.ChannelHandlerContext,
 *      org.jboss.netty.handler.timeout.IdleStateEvent)
 */
@Override
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) {
    logger.debug("In IDLE event handler for UDP..timeout.");

    // there are 3 states. READER/WRITER/ALL
    if (e.getState() == IdleState.ALL_IDLE) {
        int statusCodeInt = 1;
        String statusCode = statusCodeInt + " FAILURE";
        String errMsg = "UDP idle (read) timeout";

        udpWorker.onComplete(udpWorker.responseSb.toString(), true,
                errMsg, errMsg, statusCode, statusCodeInt);
    }
}
 
开发者ID:eBay,项目名称:parallec,代码行数:24,代码来源:UdpWorker.java

示例5: channelIdle

@Override
public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e)
        throws InterruptedException {
    if (e.getState() == IdleState.ALL_IDLE) {
        this.closeChannel(ctx, 1011, Text.REACH_MAX_IDLE);
        this.logger.info(Text.REACH_MAX_IDLE_AND_CLOSE, this.maxIdleTimeSeconds);
    }
}
 
开发者ID:kuiwang,项目名称:my-dev,代码行数:8,代码来源:MaxIdleTimeHandler.java


注:本文中的org.jboss.netty.handler.timeout.IdleState.ALL_IDLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。