**使用java编码的springboot项目在调用C语言等其他语言编写的Tcp接口时,使用netty框架可以实现数据双向持续交互处理。 注:在交互过程中,c语言生成的二进制字节码转java字符串时往往出现乱码,请看后面处理方式(netty处理类中的代码)。** 一、引入netty的jar包 io.netty netty-all 二、使用netty框架 1、创建客户端 package com.iflytek.digtal.netty; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; /**...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with cf.channel .closeFuture
Contact cf.channel .closeFuture, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack