package com.simple.netty;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
public class UDPServer {
public static void main(String[] args) {
Bootstrap strap = new Bootstrap();
EventLoopGroup workerGroup = new NioEventLoopGroup();
strap.channel(NioDatagramChannel.class).group(workerGroup)
.handler(new ChannelInitializer() {
@Override
protected void initChannel(Channe