|
@@ -50,6 +50,11 @@ public class NettyServer {
|
|
|
|
|
|
@Value("${debug.justReceivePacket}")
|
|
|
private Boolean isJustReceivePacket;
|
|
|
+ @Value("${debug.decode}")
|
|
|
+ private Boolean decodePacketOrNot;
|
|
|
+
|
|
|
+ @Value("${netty.recvBufferSize}")
|
|
|
+ private Integer recvBufferSize;
|
|
|
|
|
|
private DelayQueue<BasePackage> sendingQueue = new DelayQueue<>();
|
|
|
|
|
@@ -72,13 +77,15 @@ public class NettyServer {
|
|
|
Decoder decoder = new Decoder();
|
|
|
NettyServerHandler nettyServerHandler = new NettyServerHandler();
|
|
|
decoder.setShowRecvBytes(this.showRecvBytes);
|
|
|
+ decoder.setDecode(this.decodePacketOrNot);
|
|
|
+ log.info("Netty-Server decode showRecvBytes:{} decodePacketOrNot:{}", this.showRecvBytes, this.decodePacketOrNot);
|
|
|
|
|
|
bootstrap.group(group)
|
|
|
// 指定Channel
|
|
|
.channel(useMultiThread ? EpollDatagramChannel.class : NioDatagramChannel.class)
|
|
|
|
|
|
.option(ChannelOption.SO_BROADCAST, true)
|
|
|
- .option(ChannelOption.SO_RCVBUF, 1024 * 1024 * 10)
|
|
|
+ .option(ChannelOption.SO_RCVBUF, 1024 * 1024 * recvBufferSize)
|
|
|
|
|
|
.handler(new ChannelInitializer<Channel>() {
|
|
|
@Override
|