资源简介

SpringBoot2.x集成Netty4.x创建基于无连接协议UDP协议的服务端和客户端的Demo代码案例

资源截图

代码片段和文件信息

package boot.netty.udp.client;


import java.net.InetSocketAddress;
import boot.netty.udp.client.adapter.BootNettyUdpClientSimpleChannelInboundHandler;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.DatagramPacket;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.util.CharsetUtil;

public class BootNettyUdpClient {

public void bind(String address int port String data) {

EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
try {
            Bootstrap clientBootstrap = new Bootstrap();
            clientBootstrap = clientBoo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1558  2020-05-13 16:12  boot-netty_udp\boot-netty-udp-client\pom.xml

     文件       1896  2020-05-13 15:42  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp\client\adapter\BootNettyUdpClientSimpleChannelInboundHandler.java

     文件       2836  2020-05-13 16:07  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp\client\BootNettyUdpClient.java

     文件        528  2020-05-13 15:44  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp\client\BootNettyUdpClientApplication.java

     文件        131  2020-05-13 14:11  boot-netty_udp\boot-netty-udp-client\src\test\java\boot\netty\udp\client\BootNettyUdpClientApplicationTest.java

     文件       1549  2020-05-13 16:13  boot-netty_udp\boot-netty-udp-server\pom.xml

     文件        927  2020-05-05 10:29  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty\udp\adapter\BootNettyUdpSimpleChannelInboundHandler.java

     文件        890  2020-05-05 10:24  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty\udp\BootNettyUdpApplication.java

     文件       1385  2020-05-05 10:58  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty\udp\BootNettyUdpServer.java

     文件         22  2020-05-05 10:33  boot-netty_udp\boot-netty-udp-server\src\main\resources\application.properties

     文件         98  2020-05-05 10:12  boot-netty_udp\boot-netty-udp-server\src\test\java\boot\netty\udp\AppTest.java

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp\client\adapter

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp\client

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\test\java\boot\netty\udp\client

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty\udp\adapter

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty\udp

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\test\java\boot\netty\udp

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty\udp

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\test\java\boot\netty\udp

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java\boot\netty

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\test\java\boot\netty

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\main\java\boot\netty

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\test\java\boot\netty

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java\boot

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\test\java\boot

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\main\java\boot

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\test\java\boot

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\main\java

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-client\src\test\java

     目录          0  2020-05-13 16:11  boot-netty_udp\boot-netty-udp-server\src\main\java

............此处省略14个文件信息

评论

共有 条评论