Netty解决粘包拆包问题,Netty使用自定义编解码器解决粘包拆包问题

2023-05-16

文章目录

  • 一、什么是粘包拆包
  • 二、粘包拆包实例
    • 1、Server端
    • 2、Client端
    • 3、测试一下
  • 三、解决粘包拆包的方案
  • 四、使用自定义编解码器解决粘包拆包问题
    • 1、定义协议包
    • 2、编解码器
    • 3、server端
    • 4、client端
    • 5、测试一下

一、什么是粘包拆包

TCP 是面向连接的,面向流的,提供高可靠性服务。收发两端(客户端和服务器端) 都要有一一成对的 socket,因此,发送端为了将多个发给接收端的包,更有效的发给对方,使用了优化方法(Nagle 算法),将多次间隔较小且数据量小的数据,合并成一个大的数据块,然后进行封包。这样做虽然提高了效率,但是接收端就难于分辨出完整的数据包了,因为面向流的通信是无消息保护边界的。

优于TCP无消息保护边界,需要在接收端处理消息边界问题,也就是我们所说的粘包、拆包问题。

在这里插入图片描述
我们从图中可以看出,客户端发送的D1和D2数据,是有可能会被拆分开进行数据传输的,Server端如果不做特殊处理的话,不知道D1和D2的数据边界,可能会少读或者多读,导致数据错乱。

二、粘包拆包实例

1、Server端


import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;

public class MyServer {
    public static void main(String[] args) throws Exception{

        EventLoopGroup bossGroup = new NioEventLoopGroup(1);
        EventLoopGroup workerGroup = new NioEventLoopGroup();

        try {

            ServerBootstrap serverBootstrap = new ServerBootstrap();
            serverBootstrap.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).childHandler(new MyServerInitializer()); //自定义一个初始化类


            ChannelFuture channelFuture = serverBootstrap.bind(7000).sync();
            channelFuture.channel().closeFuture().sync();

        }finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }

    }
}


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyServerInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

        pipeline.addLast(new MyServerHandler());
    }
}



import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.Charset;
import java.util.UUID;

public class MyServerHandler extends SimpleChannelInboundHandler<ByteBuf>{
    private int count;

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        //cause.printStackTrace();
        ctx.close();
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {

        byte[] buffer = new byte[msg.readableBytes()];
        msg.readBytes(buffer);

        //将buffer转成字符串
        String message = new String(buffer, Charset.forName("utf-8"));

        System.out.println("服务器接收到数据 " + message);
        System.out.println("服务器接收到消息量=" + (++this.count));

        //服务器回送数据给客户端, 回送一个随机id ,
        ByteBuf responseByteBuf = Unpooled.copiedBuffer(UUID.randomUUID().toString() + " ", Charset.forName("utf-8"));
        ctx.writeAndFlush(responseByteBuf);

    }
}

2、Client端

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

public class MyClient {
    public static void main(String[] args)  throws  Exception{

        EventLoopGroup group = new NioEventLoopGroup();

        try {

            Bootstrap bootstrap = new Bootstrap();
            bootstrap.group(group).channel(NioSocketChannel.class)
                    .handler(new MyClientInitializer()); //自定义一个初始化类

            ChannelFuture channelFuture = bootstrap.connect("localhost", 7000).sync();

            channelFuture.channel().closeFuture().sync();

        }finally {
            group.shutdownGracefully();
        }
    }
}

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyClientInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {

        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new MyClientHandler());
    }
}


import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.Charset;

public class MyClientHandler extends SimpleChannelInboundHandler<ByteBuf> {

    private int count;
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        //使用客户端发送10条数据 hello,server 编号
        for(int i= 0; i< 10; ++i) {
            ByteBuf buffer = Unpooled.copiedBuffer("hello,server " + i, Charset.forName("utf-8"));
            ctx.writeAndFlush(buffer);
        }
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
        byte[] buffer = new byte[msg.readableBytes()];
        msg.readBytes(buffer);

        String message = new String(buffer, Charset.forName("utf-8"));
        System.out.println("客户端接收到消息=" + message);
        System.out.println("客户端接收消息数量=" + (++this.count));

    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        cause.printStackTrace();
        ctx.close();
    }
}

3、测试一下

先启动server端,再启动client端,多次启动不同client端查看结果,我们会发现server端接收的数据并没有固定的规律,这就是粘包拆包了。

服务器接收到消息量=1
服务器接收到数据 hello,server 0
服务器接收到消息量=1
服务器接收到数据 hello,server 1
服务器接收到消息量=2
服务器接收到数据 hello,server 2hello,server 3hello,server 4hello,server 5
服务器接收到消息量=3
服务器接收到数据 hello,server 6hello,server 7hello,server 8
服务器接收到消息量=4
服务器接收到数据 hello,server 9
服务器接收到消息量=5

三、解决粘包拆包的方案

Netty解决粘包和拆包问题的四种方案

四、使用自定义编解码器解决粘包拆包问题

1、定义协议包

//协议包
public class MessageProtocol {
    private int len; //关键,content的长度
    private byte[] content;

    public int getLen() {
        return len;
    }

    public void setLen(int len) {
        this.len = len;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }
}

2、编解码器

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ReplayingDecoder;

import java.util.List;

public class MyMessageDecoder extends ReplayingDecoder<Void> {
    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        System.out.println("MyMessageDecoder decode 被调用");
        //需要将得到二进制字节码-> MessageProtocol 数据包(对象)

        // 通过长度,获取我们的content
        int length = in.readInt();

        byte[] content = new byte[length];
        in.readBytes(content);

        //封装成 MessageProtocol 对象,放入 out, 传递下一个handler业务处理
        MessageProtocol messageProtocol = new MessageProtocol();
        messageProtocol.setLen(length);
        messageProtocol.setContent(content);

        // 消息传递给下一个handler
        //out.add(messageProtocol);
        // 这样也行
        ctx.fireChannelRead(messageProtocol);

    }
}

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

public class MyMessageEncoder extends MessageToByteEncoder<MessageProtocol> {
    @Override
    protected void encode(ChannelHandlerContext ctx, MessageProtocol msg, ByteBuf out) throws Exception {
        System.out.println("MyMessageEncoder encode 方法被调用");
        // 编码
        out.writeInt(msg.getLen());
        out.writeBytes(msg.getContent());
    }
}

3、server端

import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;

public class MyServer {
    public static void main(String[] args) throws Exception{

        EventLoopGroup bossGroup = new NioEventLoopGroup(1);
        EventLoopGroup workerGroup = new NioEventLoopGroup();

        try {

            ServerBootstrap serverBootstrap = new ServerBootstrap();
            serverBootstrap.group(bossGroup,workerGroup).channel(NioServerSocketChannel.class).childHandler(new MyServerInitializer()); //自定义一个初始化类


            ChannelFuture channelFuture = serverBootstrap.bind(7000).sync();
            channelFuture.channel().closeFuture().sync();

        }finally {
            bossGroup.shutdownGracefully();
            workerGroup.shutdownGracefully();
        }

    }
}


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyServerInitializer extends ChannelInitializer<SocketChannel> {

    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

        pipeline.addLast(new MyMessageDecoder());//解码器
        pipeline.addLast(new MyMessageEncoder());//编码器
        pipeline.addLast(new MyServerHandler());
    }
}



import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.Charset;
import java.util.UUID;


//处理业务的handler
public class MyServerHandler extends SimpleChannelInboundHandler<MessageProtocol>{
    private int count;

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        //cause.printStackTrace();
        ctx.close();
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MessageProtocol msg) throws Exception {

        //接收到数据,并处理
        int len = msg.getLen();
        byte[] content = msg.getContent();

        System.out.println();
        System.out.println();
        System.out.println();
        System.out.println("服务器接收到信息如下");
        System.out.println("长度=" + len);
        System.out.println("内容=" + new String(content, Charset.forName("utf-8")));

        System.out.println("服务器接收到消息包数量=" + (++this.count));

        //回复消息

        String responseContent = UUID.randomUUID().toString();
        int responseLen = responseContent.getBytes("utf-8").length;
        byte[]  responseContent2 = responseContent.getBytes("utf-8");
        //构建一个协议包
        MessageProtocol messageProtocol = new MessageProtocol();
        messageProtocol.setLen(responseLen);
        messageProtocol.setContent(responseContent2);

        ctx.writeAndFlush(messageProtocol);


    }
}

4、client端

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;

public class MyClient {
    public static void main(String[] args)  throws  Exception{

        EventLoopGroup group = new NioEventLoopGroup();

        try {

            Bootstrap bootstrap = new Bootstrap();
            bootstrap.group(group).channel(NioSocketChannel.class)
                    .handler(new MyClientInitializer()); //自定义一个初始化类

            ChannelFuture channelFuture = bootstrap.connect("localhost", 7000).sync();

            channelFuture.channel().closeFuture().sync();

        }finally {
            group.shutdownGracefully();
        }
    }
}


import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;


public class MyClientInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {

        ChannelPipeline pipeline = ch.pipeline();
        pipeline.addLast(new MyMessageEncoder()); //加入编码器
        pipeline.addLast(new MyMessageDecoder()); //加入解码器
        pipeline.addLast(new MyClientHandler());
    }
}


import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.Charset;

public class MyClientHandler extends SimpleChannelInboundHandler<MessageProtocol> {

    private int count;
    @Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        //使用客户端发送10条数据 "你好啊,我的baby" 编号

        for(int i = 0; i< 5; i++) {
            String mes = "你好啊,我的baby";
            byte[] content = mes.getBytes(Charset.forName("utf-8"));
            int length = mes.getBytes(Charset.forName("utf-8")).length;

            //创建协议包对象
            MessageProtocol messageProtocol = new MessageProtocol();
            messageProtocol.setLen(length);
            messageProtocol.setContent(content);
            ctx.writeAndFlush(messageProtocol);

        }

    }

//    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MessageProtocol msg) throws Exception {

        int len = msg.getLen();
        byte[] content = msg.getContent();

        System.out.println("客户端接收到消息如下");
        System.out.println("长度=" + len);
        System.out.println("内容=" + new String(content, Charset.forName("utf-8")));

        System.out.println("客户端接收消息数量=" + (++this.count));

    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        System.out.println("异常消息=" + cause.getMessage());
        ctx.close();
    }
}

5、测试一下

我们发现,server端严格遵守我们的协议包进行分批次接收消息了,此时解决了粘包拆包问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Netty解决粘包拆包问题,Netty使用自定义编解码器解决粘包拆包问题 的相关文章

  • netty源码:(28)ChannelPromise

    ChannelPromise是ChannelFuture的子接口 它是可写入的 其父接口Promise定义如下 ChannelPromise有个默认的实现类 DefaultChannelPromise 它的setSuccess方法用来调用所
  • OOM 使用 320 x 16MB Netty DirectByteBuffer 对象杀死了 JVM

    我在 7 5GB RAM 服务器 无交换 中运行一个应用程序 参数如下 Xmx3g Xms3g Xlog gc XX UseG1GC XX MaxGCPauseMillis 1000 XX MaxDirectMemorySize 500m
  • Java NIO 窗口实现

    在使用 NIO 2 AIO 功能进行项目时 我查看了 旧的 NIO 选择器实现 发现在 Windows 上使用了默认的选择函数 由于内部实现不良 该函数在 Windows 上根本无法扩展 大家都知道 在 Windows 上 IOCP 是唯一
  • 无法加载库:[netty_tcnative_linux_arm_32、netty_tcnative_linux_arm_32_fedora、netty_tcnative_arm_32、netty_tcnative]

    我正在尝试在 raspberry pi modal 3 上使用 jar 运行 java 应用程序 我无法解决此问题 有人可以建议我如何在树莓派上进行这项工作吗 在 pom 中 我包含了 google cloud speech 依赖项 0 5
  • 如何在 Netty 客户端中使用 Socks4/5 代理处理程序 (4.1)

    我需要在Netty客户端中配置socks代理 通过socks4或5代理请求不同的站点 尝试了很多免费袜子列表中的代理 例如 www socks proxy net http sockslist net http sockslist net
  • 使用 Netty 的异步 HTTP 客户端

    我是 Netty 新手 仍在努力寻找自己的方法 我正在寻找创建一个异步工作的 http 客户端 http的netty例子只展示了如何等待IO操作 并没有展示如何使用添加监听器 所以最近几天我一直在努力解决这个问题 我正在尝试创建一个请求类
  • 如何阻止netty在服务器套接字上监听和接受

    有没有办法告诉 netty 停止侦听和接受套接字上的新连接 但完成当前连接上任何正在进行的工作 你可以直接关闭ServerSocketChannel由创建的ChannelFactory 通常 ServerSocketChannel由返回Se
  • 将无符号类型写入 Netty ChannelBuffer

    Netty 的 ChannelBuffer 类提供了从 ChannelBuffer 读取无符号类型的便捷方法 但是似乎没有任何等效的方法用于将无符号类型写入 ChannelBuffer 我觉得我一定错过了什么 推荐的方法是什么 例如将无符号
  • 如何在Netty中使用多个ServerBootstrap对象

    我正在尝试使用 Netty 4 0 24 在一个应用程序 一个主要方法 中创建多个服务器 多个 ServerBootstrap 我看到了这个问题 答案 但它留下了许多未解答的问题 Netty 4 0多端口 每个端口有不同的协议 https
  • Netty:如何处理从 ChunkedFile 接收到的块

    我是 netty 新手 我正在尝试将分块文件从服务器传输到客户端 发送块工作得很好 问题在于如何处理接收到的块并将它们写入文件 我尝试的两种方法都会给我带来直接缓冲区错误 任何帮助将不胜感激 Thanks Override protecte
  • Netty连接限制

    我正在开发一个使用 netty 3 6 5 的应用程序服务器 我想先了解一下期权积压的完整含义 另外 为什么没有关于 serverbootstrap 选项的文档来帮助我们开发人员 我的另一个问题是如何最好地限制服务器的并发连接数以获得更好的
  • Netty中如何发送带有POST参数的请求?

    我正在尝试在 Netty 中发送带有 POST 参数的请求 我搜索了 Netty API Google 和这里 Stack Overflow 但没有找到什么好的办法 这可能是我糟糕的搜索技巧的错 如果是这样 我道歉 有没有什么API可以轻松
  • netty DefaultChannelPipeline 异常捕获

    不幸的是 我不明白 netty 服务器的输出 BUILD SUCCESSFUL Total time 3 seconds Jul 27 2014 2 04 44 AM io netty handler logging LoggingHand
  • Netty 处理程序未调用

    我正在尝试使用简单的服务器客户端应用程序进入 Netty 代码见下文 我正在努力解决两个问题 ConfigServerHandler 分别ConfigClientHandler 被正确调用 但是 FeedbackServerHandler
  • 为什么我们真的需要多个 Netty boss 线程?

    我真的很困惑老板组的线程数量 我无法弄清楚我们需要多个老板线程的场景 在Boss 组是否需要多个线程 https stackoverflow com questions 22280916 do we need more than a sin
  • 如何使用 Netty 发送对象?

    如何通过Netty从服务器端发送bean并在客户端接收该bean 当我发送简单的整数消息 inputstream 时 它工作成功 但我需要发送 bean 如果您在客户端和服务器端使用 Netty 那么您可以使用 Netty对象解码器 htt
  • 不同的 Netty 版本及其用途

    我现在使用Netty有一段时间了 但永远无法解决这个问题 一个人可以下载四个不同的版本 其中三个正在积极开发中 3 x 4 0 x 4 1 x 5 x 据我了解 3 x 适用于 JRE 1 5 而 JRE 的其他所有版本都高于此版本 我使用
  • Netty:正确关闭 WebSocket

    如何从服务器端正确关闭 WebSocket 通道 连接 如果我使用一个ctx getChannel close the onerror在浏览器 Firefox 9 中抛出 页面加载时与 ws localhost 8080 websocket
  • 为什么我的 Camel Netty 路由会在 JMS 消息的开头添加换行符?

    我有一个 Camel Netty 路由 它将 XML 发送到服务器端口并将其放入 JMS 消息中 在第一条消息之后 所有其他消息的顶部都有一个换行符 导致当 GUI 收到它时 我的 XML 无法解组 我的路线是这样的
  • 使用 Play WS 并获取 java.net.ConnectException:Amazon Cloudfront 上的握手超时

    在我的 Play 应用程序中 我需要从 Amazon Cloudfront 下载大量文件 使用 SSL 我在链接上随机收到以下错误 play api http HttpErrorHandlerExceptions anon 1 Execut

随机推荐

  • Failed to execute child process “dbus-launch“

    场景 在ubuntu中搭建vnc桌面环境 xff0c 安装 Minimal Xfce Desktop span class token comment 精简安装 span span class token function sudo spa
  • ubuntu图形界面乱码解决办法

    现象 ubuntu的vnc远程桌面中出现了一些乱码 原因分析 从上图中可以看出英文显示正常 xff0c 那么可以判断应该是中文乱码导致的 应该是系统中没有安装中文字体导致 解决办法 方法1 xff1a 使用英文的界面 xff0c 但是我还是
  • Kylin V10 SP1(ubuntu)编译安装python3新版本

    系统自带的python太旧了 xff0c 所以想编译安装最新版本的python 环境 span class token function cat span etc release span class token assign left v
  • docker容器安装图形桌面

    文章目录 视频教程版本信息创建一个CONTAINERubuntu官方国内源docker镜像unminimize中文环境设置中文环境 安装安装TigerVNC Server安装 xfce4精简版本 配置设置vnc密码 vnc xstartup
  • ubuntu官方国内源

    背景 之前我一直在使用中科大的源 xff0c 还是挺快的 一直也没有感觉有什么问题 直到最近在折腾vnc xff0c 发现中科大的源有一些包会404 xff0c 安装不了 而我在vmware中的正好是默认的cn archive ubuntu
  • iterm2禁用鼠标选择复制

    iterm2默认选中文字就自动复制到剪切板 xff0c 方便是挺方便 但是有时候 xff0c 复制了一段文字想贴到iterm2中 xff0c 结果鼠标一滑 xff0c 不小心选择到了文字了 xff0c 之前复制的内容就被替换了 那么怎么关闭
  • Ant Design for React Native精简笔记

    背景 Ant Design是一套不错的UI组件库 xff0c 功能强大 但是依赖了很多其他的组件 xff0c 在RN6 3以后要自己安装以下组件才能正常使用 span class token function yarn span span
  • yarn使用说明

    yarn优点 速度超快 Yarn 缓存了每个下载过的包 xff0c 所以再次使用时无需重复下载 同时利用并行下载以最大化资源利用率 xff0c 因此安装速度更快 超级安全 在执行代码之前 xff0c Yarn 会通过算法校验每个安装包的完整
  • Netty编解码器,Netty自定义编解码器解决粘包拆包问题,Netty编解码器的执行过程详解

    文章目录 一 编解码器概述1 编解码器概述2 编码器类关系图3 解码器类关系图 二 以编解码器为例理解入站出站1 Server端2 Client端3 编解码器3 执行查看结果4 注意事项 三 Netty其他内置编解码器1 Replaying
  • ERROR Error: Reanimated 2 failed to create a worklet

    报错 To reload the app press span class token string 34 r 34 span To span class token function open span developer menu pr
  • React Native创建一个新的项目常用命令

    创建项目 创建一个typescript项目 npx react native init ywh template react native template typescript 导入库 整合 方便一键安装 以下仅是本人常用的组件 xff0
  • 各操作系统支持图标字体的终端推荐

    软件推荐 操作系统推荐macOSiTerm2windowsWindows TerminallinuxGNOME 终端 等androidTermux或TermiusiOSTermius 不完美 如果你在macOS我推荐你使用iterm2 xf
  • MAME set 4 player

    背景 我本身有一个手柄 xff0c 准备12 12在入手一个 然后小杨同学就把他的一对手柄借给我啦 xff0c 让我试试手感 xff0c 好决定买哪个 那么我现在就有3个手柄可以使用 我就想找个3个人以上的游戏来玩玩 首先我就想到了玩街机
  • [视频教程]macOS运行MAME

    操作视频 https www bilibili com video BV1Nr4y1D7SQ 安装 brew span class token function install span mame ROM 把roms文件夹放到以下目录 xf
  • [视频教程]MAME画质优化hq3x

    关于滤镜 xff0c 萝卜白菜各有所爱 我个人喜欢hq3x的画质 视频教程 https www bilibili com video BV1Ji4y1d7j6 默认画质 hq3x 加了层滤镜 xff0c 显示更平滑了 配置方法 核心配置 搜
  • macOS安装最新MAME 报错dyld: Library not loaded:

    在macOS中安装最新版本的MAME 报错 mame dyld Library not loaded 64 rpath SDL2 framework Versions A SDL2 Referenced from Users itkey m
  • ‘@typescript-eslint/no-shadow‘ was not found

    我新建了一个React Native项目 xff0c 然后IDE报错如下 以前新建的项目是不会有任何报错信息的 报错信息 Definition for rule 64 typescript eslint no shadow was not
  • 纯javascript代码修改react 的输入框的值

    背景 我们有一个老的项目在维护 xff0c 项目是使用react dom 64 16 8 6实现的 也就是react开发的 xff0c 但是因为某种原因 xff0c 暂时找不到源码了 时间紧任务重 xff0c 必须赶紧解决问题 简化需求 x
  • 【视频教程】MAME0.238配置分享

    视频链接 https www bilibili com video BV15q4y1B7Hn 附件下载 百度网盘分享 链接 https pan baidu com s 1rsBdRn99 KWjhRpPrGBmfw 提取码 4ge5CSDN
  • Netty解决粘包拆包问题,Netty使用自定义编解码器解决粘包拆包问题

    文章目录 一 什么是粘包拆包二 粘包拆包实例1 Server端2 Client端3 测试一下 三 解决粘包拆包的方案四 使用自定义编解码器解决粘包拆包问题1 定义协议包2 编解码器3 server端4 client端5 测试一下 一 什么是