同步操作将从 baolinking/物联网关 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/****/package connect;import java.util.Date;import javax.annotation.Resource;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Configuration;import divpro.DivChannelInitializer;import freeconfig.GetProperties;import io.netty.bootstrap.ServerBootstrap;import io.netty.channel.ChannelFuture;import io.netty.channel.ChannelOption;import io.netty.channel.EventLoopGroup;import io.netty.channel.nio.NioEventLoopGroup;import io.netty.channel.socket.nio.NioServerSocketChannel;import jedis.Jedisclusters;/*** @Description:* 心跳时间,不同设备或厂家的心跳时间是不同的,按配置更改就行* @author: wbl* @date: 2019年8月30日 上午10:04:44*/@Configurationpublic class ToClientDesign implements Runnable{private int poolNum = 0;@Resourcepublic static Jedisclusters jedisCluster;public ToClientDesign(int poolnum){this.poolNum = poolnum;}@Overridepublic void run() {EventLoopGroup bossGroup = new NioEventLoopGroup(ConfigDesign.BIZGROUPSIZE);EventLoopGroup workerGroup = new NioEventLoopGroup(ConfigDesign.BIZTHREADSIZE);try {ServerBootstrap gateServer = new ServerBootstrap();gateServer.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).option(ChannelOption.SO_BACKLOG, ConfigDesign.CACHESIZE).childHandler(new DivChannelInitializer());String port = GetProperties.getValue("client.port");System.out.println("read client config:"+port);ChannelFuture f = gateServer.bind(Integer.parseInt(port)).sync();System.out.println("bind: ["+new Date()+"] 服务器开始监听端口"+port+",等待客户端连接.........");f.channel().closeFuture().sync();} catch (InterruptedException e) {e.printStackTrace();} finally {/**优雅退出,释放线程池资源*/bossGroup.shutdownGracefully();workerGroup.shutdownGracefully();}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。