perf: 优化性能
This commit is contained in:
@@ -3,7 +3,7 @@ setArchivesBaseName("HamsterBall-Server")
|
||||
evaluationDependsOn(':hamster-ball-common')
|
||||
|
||||
dependencies {
|
||||
apiShade(project(":hamster-ball-common")) { transitive = false }
|
||||
apiShade project(":hamster-ball-common") transitive false
|
||||
|
||||
// // https://mvnrepository.com/artifact/org.slf4j/slf4j-api
|
||||
// implementation 'org.slf4j:slf4j-api:2.0.3'
|
||||
|
@@ -13,10 +13,6 @@ import org.slf4j.LoggerFactory;
|
||||
public class BallServerChannelHandler extends SimpleChannelInboundHandler<String> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("BallServerChannelHandler");
|
||||
|
||||
public BallServerChannelHandler() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext context, String message) {
|
||||
if ("ping".equals(message)) {
|
||||
|
@@ -24,9 +24,6 @@ public class BallServerChannelInitializer extends ChannelInitializer<SocketChann
|
||||
public static final List<Channel> CHANNELS = new ArrayList<>();
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("BallServerChannelInitializer");
|
||||
|
||||
public BallServerChannelInitializer() {
|
||||
}
|
||||
|
||||
public static void broadcastMessage(BallMessageInfo messageInfo) {
|
||||
String string = messageInfo.toString();
|
||||
synchronized (CHANNELS) {
|
||||
|
@@ -11,10 +11,6 @@ import org.slf4j.LoggerFactory;
|
||||
public class BallServerKeepAliveHandler extends SimpleUserEventChannelHandler<IdleStateEvent> {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("BallServerKeepAliveHandler");
|
||||
|
||||
public BallServerKeepAliveHandler() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void eventReceived(ChannelHandlerContext context, IdleStateEvent event) {
|
||||
context.close();
|
||||
|
Reference in New Issue
Block a user