perf: 优化性能

This commit is contained in:
2023-06-01 09:04:44 +08:00
parent 503ba16c6e
commit 0ca763ebdb
9 changed files with 21 additions and 24 deletions

View File

@@ -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'

View File

@@ -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)) {

View File

@@ -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) {

View File

@@ -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();