package com.its.cctv.xnettcp; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.EventLoopGroup; import lombok.Getter; import lombok.Setter; import lombok.ToString; import lombok.extern.slf4j.Slf4j; @Slf4j @Getter @Setter @ToString public abstract class TcpServerAbstract { protected EventLoopGroup workerGroups = null; protected EventLoopGroup acceptGroups = null; protected ServerBootstrap serverBootstrap = null; protected ChannelFuture channelFuture = null; protected int getWorkerThreads() { return Runtime.getRuntime().availableProcessors() * 2; } protected int getAcceptThreads() { int acceptThreads = Math.max(1, getWorkerThreads() / 4); return acceptThreads; } }