Commit bdba4d50 authored by duanruiming's avatar duanruiming

[update] 方法权限

parent 9cc62355
...@@ -5,12 +5,9 @@ import cn.hutool.core.util.HexUtil; ...@@ -5,12 +5,9 @@ import cn.hutool.core.util.HexUtil;
import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.*; import io.netty.channel.*;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket; import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.nio.NioDatagramChannel; import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.util.concurrent.GlobalEventExecutor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.com.cache.netty.NettyMessageCache; import net.wanji.com.cache.netty.NettyMessageCache;
import net.wanji.com.netty.handler.NettyServerHandler; import net.wanji.com.netty.handler.NettyServerHandler;
...@@ -33,7 +30,6 @@ import java.util.concurrent.TimeUnit; ...@@ -33,7 +30,6 @@ import java.util.concurrent.TimeUnit;
public class NettyClient { public class NettyClient {
private static final Map<String, ChannelId> IP_PORT_CHANNEL_ID_MAP = new HashMap<>(); private static final Map<String, ChannelId> IP_PORT_CHANNEL_ID_MAP = new HashMap<>();
private static ChannelGroup channelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
private static ChannelFuture udpChannelFuture = null; private static ChannelFuture udpChannelFuture = null;
/** /**
......
...@@ -41,7 +41,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPack ...@@ -41,7 +41,7 @@ public class NettyServerHandler extends SimpleChannelInboundHandler<DatagramPack
* @throws Exception * @throws Exception
*/ */
@Override @Override
public void channelRead0(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception { protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception {
log.info("收到服务端包数据: {}", packet); log.info("收到服务端包数据: {}", packet);
ByteBuf content = packet.content(); ByteBuf content = packet.content();
InetSocketAddress sender = packet.sender(); InetSocketAddress sender = packet.sender();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment