- 浏览: 945774 次
文章分类
- 全部博客 (428)
- Hadoop (2)
- HBase (1)
- ELK (1)
- ActiveMQ (13)
- Kafka (5)
- Redis (14)
- Dubbo (1)
- Memcached (5)
- Netty (56)
- Mina (34)
- NIO (51)
- JUC (53)
- Spring (13)
- Mybatis (17)
- MySQL (21)
- JDBC (12)
- C3P0 (5)
- Tomcat (13)
- SLF4J-log4j (9)
- P6Spy (4)
- Quartz (12)
- Zabbix (7)
- JAVA (9)
- Linux (15)
- HTML (9)
- Lucene (0)
- JS (2)
- WebService (1)
- Maven (4)
- Oracle&MSSQL (14)
- iText (11)
- Development Tools (8)
- UTILS (4)
- LIFE (8)
最新评论
-
Donald_Draper:
Donald_Draper 写道刘落落cici 写道能给我发一 ...
DatagramChannelImpl 解析三(多播) -
Donald_Draper:
刘落落cici 写道能给我发一份这个类的源码吗Datagram ...
DatagramChannelImpl 解析三(多播) -
lyfyouyun:
请问楼主,执行消息发送的时候,报错:Transport sch ...
ActiveMQ连接工厂、连接详解 -
ezlhq:
关于 PollArrayWrapper 状态含义猜测:参考 S ...
WindowsSelectorImpl解析一(FdMap,PollArrayWrapper) -
flyfeifei66:
打算使用xmemcache作为memcache的客户端,由于x ...
Memcached分布式客户端(Xmemcached)
Netty系列之Netty高性能之道:http://www.infoq.com/cn/articles/netty-high-performance
Nio通讯框架学习:http://guojuanjun.blog.51cto.com/277646/841342/
Netty是什么:http://lippeng.iteye.com/blog/1907279
Java NIO框架Netty教程:http://blog.csdn.net/kobejayandy/article/details/11495509
netty初步,与各个版本的比较 :http://blog.csdn.net/u010154380/article/details/46988269
Netty版本升级血泪史之线程篇:http://www.infoq.com/cn/articles/netty-version-upgrade-history-thread-part/
Netty是由JBOSS提供的一个java开源框架。Netty提供异步的、事件驱动的网络应用程序框架和工具,用以快速开发高性能、高可靠性的网络服务器和客户端程序。具体的我们就不在详讲,参看上面的引用连接。
从今天起,我们从netty的几个实例来看,如何构建网络通信,本文中的所用的netty版本为4.1.12,相关的源码github地址为https://github.com/Donaldhan/netty_demo:
实例1,简单的消息通信应用:
服务端:
服务端处理器:
客户端:
客户端处理器:
分别启动服务端与客户端,控制台输出:
服务端:
[INFO ] 2017-07-05 21:23:51 netty.main.echo.EchoServer =========Server is start=========
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] REGISTERED
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] ACTIVE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] READ: 15B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 65 6c 6c 6f 20 53 65 72 76 65 72 2e 2e 2e |Hello Server... |
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 netty.handler.echo.EchoServerHandler ===Server reciever message:Hello Server...
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] WRITE: 16B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 68 65 6c 6c 6f 20 63 6c 69 65 6e 74 20 2e 2e 2e |hello client ...|
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] READ COMPLETE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] FLUSH
客户端:
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79] REGISTERED
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79] CONNECT: /192.168.31.153:10010
[INFO ] 2017-07-05 21:23:59 netty.main.echo.EchoClient =========Client is start=========
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] ACTIVE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] WRITE: 15B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 65 6c 6c 6f 20 53 65 72 76 65 72 2e 2e 2e |Hello Server... |
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] FLUSH
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] READ: 16B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 68 65 6c 6c 6f 20 63 6c 69 65 6e 74 20 2e 2e 2e |hello client ...|
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 netty.handler.echo.EchoClientHandler ===Client reciever ack message from Server:hello client ...
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] READ COMPLETE
Nio通讯框架学习:http://guojuanjun.blog.51cto.com/277646/841342/
Netty是什么:http://lippeng.iteye.com/blog/1907279
Java NIO框架Netty教程:http://blog.csdn.net/kobejayandy/article/details/11495509
netty初步,与各个版本的比较 :http://blog.csdn.net/u010154380/article/details/46988269
Netty版本升级血泪史之线程篇:http://www.infoq.com/cn/articles/netty-version-upgrade-history-thread-part/
Netty是由JBOSS提供的一个java开源框架。Netty提供异步的、事件驱动的网络应用程序框架和工具,用以快速开发高性能、高可靠性的网络服务器和客户端程序。具体的我们就不在详讲,参看上面的引用连接。
从今天起,我们从netty的几个实例来看,如何构建网络通信,本文中的所用的netty版本为4.1.12,相关的源码github地址为https://github.com/Donaldhan/netty_demo:
实例1,简单的消息通信应用:
服务端:
package netty.main.echo; import java.net.InetSocketAddress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.SelfSignedCertificate; import netty.handler.echo.EchoServerHandler; /** * Discards any incoming data. * @author donald * 2017年6月16日 * 上午9:39:53 */ public class EchoServer { private static final Logger log = LoggerFactory.getLogger(EchoServer.class); static final boolean SSL = System.getProperty("ssl") != null; private static final String ip = "192.168.31.153"; private static final int port = 10010; public static void main(String[] args) throws Exception { run(); } public static void run() throws Exception { // Configure SSL. final SslContext sslCtx; if (SSL) { SelfSignedCertificate ssc = new SelfSignedCertificate(); sslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey()).build(); } else { sslCtx = null; } /* * EventLoopGroup(多线程事件loop),处理IO操作,这里我们用了两个事件loop * 第一个用于处理器监听连接请求,第二个用于数据的传输; * 具体线程是多少依赖于事件loop的具体实现 * */ EventLoopGroup bossGroup = new NioEventLoopGroup(); // (1) EventLoopGroup workerGroup = new NioEventLoopGroup(); try { //ServerBootstrap,用于配置服务端,一般为ServerSocket通道 ServerBootstrap serverBoot = new ServerBootstrap(); serverBoot.group(bossGroup, workerGroup) .channel(NioServerSocketChannel.class) .childHandler(new ChannelInitializer<SocketChannel>() { @Override public void initChannel(SocketChannel ch) throws Exception { //添加通道处理器到通道关联的管道,准确的中文翻译为管道线, 此管道线与Mina中过滤链十分相似, //ChannelInitializer用于配置通道的管道线,ChannelPipeline ChannelPipeline pipeline = ch.pipeline(); if (sslCtx != null) { pipeline.addLast(sslCtx.newHandler(ch.alloc())); } pipeline.addLast(new LoggingHandler(LogLevel.INFO)); pipeline.addLast(new EchoServerHandler()); } }) .option(ChannelOption.SO_BACKLOG, 128)//socket监听器连接队列大小、 .childOption(ChannelOption.SO_KEEPALIVE, true); //保活,此配置针对ServerSocket通道接收连接产生的Socket通道 InetSocketAddress inetSocketAddress = new InetSocketAddress(ip,port); // 绑定地址,开始监听 ChannelFuture f = serverBoot.bind(inetSocketAddress).sync(); log.info("=========Server is start========="); //等待,直到ServerSocket关闭 f.channel().closeFuture().sync(); } finally { workerGroup.shutdownGracefully(); bossGroup.shutdownGracefully(); } } }
服务端处理器:
package netty.handler.echo; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.CharsetUtil; import io.netty.util.ReferenceCountUtil; /** * Handles a server-side channel. * @author donald * 2017年6月16日 * 上午9:36:53 */ public class EchoServerHandler extends ChannelInboundHandlerAdapter { private static final Logger log = LoggerFactory.getLogger(EchoServerHandler.class); /** * 读client通道数据,通道处理器上下文ChannelHandlerContext与Mina的会话很像 */ @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { ByteBuf in = (ByteBuf)msg; byte[] bytes = new byte[in.writerIndex()]; in.readBytes(bytes); //针对堆buf,direct buf不支持 // byte[] bytes = in.array(); String message = null; try { message = new String(bytes,"UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } try{ log.info("===Server reciever message:" +message); } finally{ //如果msg为引用计数对象,在使用后注意释放,一般在通道handler中释放 // ReferenceCountUtil.release(msg); } String ackMessage = "hello client ..."; in.clear(); try { in.writeBytes(ackMessage.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } ctx.write(in); } @Override public void channelReadComplete(ChannelHandlerContext ctx) { ctx.flush(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { //异常发生时,关闭连接 cause.printStackTrace(); ctx.close(); } }
客户端:
package netty.main.echo; import java.net.InetSocketAddress; import javax.net.ssl.SSLException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import netty.handler.echo.EchoClientHandler; /** * * @author donald * 2017年6月20日 * 下午12:44:58 */ public final class EchoClient { private static final Logger log = LoggerFactory.getLogger(EchoClient.class); private static final boolean SSL = System.getProperty("ssl") != null; private static final String ip = System.getProperty("host", "192.168.31.153"); private static final int port = Integer.parseInt(System.getProperty("port", "10010")); public static void main(String[] args) throws Exception { run(); } private static void run() throws SSLException, InterruptedException{ //配置安全套接字上下文 final SslContext sslCtx; if (SSL) { sslCtx = SslContextBuilder.forClient() .trustManager(InsecureTrustManagerFactory.INSTANCE).build(); } else { sslCtx = null; } EventLoopGroup workerGroup = new NioEventLoopGroup(); try { //Bootstrap,用于配置客户端,一般为Socket通道 Bootstrap bootstrap = new Bootstrap(); bootstrap.group(workerGroup) .channel(NioSocketChannel.class) .handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { //添加安全套接字处理器和通道处理器到 ChannelPipeline pipeline = ch.pipeline(); if (sslCtx != null) { pipeline.addLast(sslCtx.newHandler(ch.alloc(), ip, port)); } pipeline.addLast(new LoggingHandler(LogLevel.INFO)); pipeline.addLast(new EchoClientHandler()); } }); InetSocketAddress inetSocketAddress = new InetSocketAddress(ip,port); //连接socket地址 ChannelFuture f = bootstrap.connect(inetSocketAddress).sync(); log.info("=========Client is start========="); //等待,直到连接关闭 f.channel().closeFuture().sync(); } finally { workerGroup.shutdownGracefully(); } } }
客户端处理器:
package netty.handler.echo; import java.io.UnsupportedEncodingException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; /** * * @author donald * 2017年6月20日 * 下午12:45:04 */ public class EchoClientHandler extends ChannelInboundHandlerAdapter { private static final Logger log = LoggerFactory.getLogger(EchoClientHandler.class); private final ByteBuf firstMessage; public EchoClientHandler() { String message = "Hello Server..."; firstMessage = Unpooled.buffer(1024);//堆buffer try { firstMessage.writeBytes(message.getBytes("UTF-8")); firstMessage.retainedDuplicate(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } @Override public void channelActive(ChannelHandlerContext ctx) { ctx.write(firstMessage); ctx.flush(); } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf in = (ByteBuf)msg; byte[] bytes = new byte[in.writerIndex()]; in.readBytes(bytes); //针对堆buf,direct buf不支持 // byte[] bytes = in.array(); String message = new String(bytes,"UTF-8"); log.info("===Client reciever ack message from Server:" +message); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } }
分别启动服务端与客户端,控制台输出:
服务端:
[INFO ] 2017-07-05 21:23:51 netty.main.echo.EchoServer =========Server is start=========
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] REGISTERED
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] ACTIVE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] READ: 15B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 65 6c 6c 6f 20 53 65 72 76 65 72 2e 2e 2e |Hello Server... |
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 netty.handler.echo.EchoServerHandler ===Server reciever message:Hello Server...
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] WRITE: 16B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 68 65 6c 6c 6f 20 63 6c 69 65 6e 74 20 2e 2e 2e |hello client ...|
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] READ COMPLETE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xa4c1b700, L:/192.168.31.153:10010 - R:/192.168.31.153:28426] FLUSH
客户端:
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79] REGISTERED
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79] CONNECT: /192.168.31.153:10010
[INFO ] 2017-07-05 21:23:59 netty.main.echo.EchoClient =========Client is start=========
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] ACTIVE
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] WRITE: 15B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 48 65 6c 6c 6f 20 53 65 72 76 65 72 2e 2e 2e |Hello Server... |
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] FLUSH
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] READ: 16B
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 68 65 6c 6c 6f 20 63 6c 69 65 6e 74 20 2e 2e 2e |hello client ...|
+--------+-------------------------------------------------+----------------+
[INFO ] 2017-07-05 21:23:59 netty.handler.echo.EchoClientHandler ===Client reciever ack message from Server:hello client ...
[INFO ] 2017-07-05 21:23:59 io.netty.handler.logging.LoggingHandler [id: 0xbd3abb79, L:/192.168.31.153:28426 - R:/192.168.31.153:10010] READ COMPLETE
发表评论
-
netty NioSocketChannel解析
2017-09-29 12:50 1221netty 抽象BootStrap定义:http://dona ... -
netty Pooled字节buf分配器
2017-09-28 13:00 1956netty 字节buf定义:http://donald-dra ... -
netty Unpooled字节buf分配器
2017-09-26 22:01 2342netty 字节buf定义:http://donald-dra ... -
netty 抽象字节buf分配器
2017-09-26 08:43 1247netty 字节buf定义:http:// ... -
netty 复合buf概念
2017-09-25 22:31 1241netty 字节buf定义:http://donald-dra ... -
netty 抽象字节buf引用计数器
2017-09-22 12:48 1498netty 字节buf定义:http://donald-dra ... -
netty 抽象字节buf解析
2017-09-22 09:00 1745netty 通道接口定义:http://donald-drap ... -
netty 资源泄漏探测器
2017-09-21 09:37 1314netty 通道接口定义:http://donald-drap ... -
netty 字节buf定义
2017-09-20 08:31 2742netty 通道接口定义:http://donald-drap ... -
netty 默认通道配置后续
2017-09-18 08:36 2080netty 通道接口定义:http://donald-drap ... -
netty 默认通道配置初始化
2017-09-17 22:51 1928netty 通道接口定义:http://donald-drap ... -
netty 通道配置接口定义
2017-09-17 14:51 997netty 通道接口定义:http://donald-drap ... -
netty NioServerSocketChannel解析
2017-09-16 13:01 1798netty ServerBootStrap解析:http:// ... -
netty 抽象nio消息通道
2017-09-15 15:30 1145netty 通道接口定义:http:/ ... -
netty 抽象nio字节通道
2017-09-14 22:39 1133netty 通道接口定义:http:/ ... -
netty 抽象nio通道解析
2017-09-14 17:23 883netty 通道接口定义:http://donald-drap ... -
netty 抽象通道后续
2017-09-13 22:40 1220netty Inboudn/Outbound通道Inv ... -
netty 通道Outbound缓冲区
2017-09-13 14:31 2115netty 通道接口定义:http:/ ... -
netty 抽象Unsafe定义
2017-09-12 21:24 983netty 通道接口定义:http:/ ... -
netty 抽象通道初始化
2017-09-11 12:56 1772netty 管道线定义-ChannelPipeline:htt ...
相关推荐
1、基于Spring Boot 实现的WebSocket实时数据通信Demo 2、结合Netty实现多客户端之间进行网络通信 3、在Web端建立多客户端之间的通信机制
本demo紧密结合了本人发布的《初识Netty》一文中的示例,为学习者提供了一个直观、实用的学习参考。项目中,你可以清晰地看到BIO与NIO模型在Netty中的灵活运用,如何通过Netty的高性能特性来优化网络通信。此外,...
1. 异步和事件驱动:Netty 使用异步和事件驱动的方式来处理网络通信,这意味着它不会阻塞调用线程,从而提高了应用的响应性和吞吐量。 2. 高性能:Netty 的设计使得它成为了目前所有 NIO 框架中性能最好的框架之一。...
主要给大家介绍了关于如何利用Java搭建个简单的Netty通信,文中通过示例代码介绍的非常详细,对大家学习或者使用Java具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
25_gRPC通信示例与JVM回调钩子 26_gRPC服务器流式调用实现 27_gRPC双向流式数据通信详解 28_gRPC与Gradle流畅整合及问题解决的完整过程与思考 29_Gradle插件问题解决方案与Nodejs环境搭建 30_通过gRPC实现Java与...
第25讲:gRPC通信示例与JVM回调钩子 第26讲:gRPC服务器流式调用实现 第27讲:gRPC双向流式数据通信详解 第28讲:gRPC与Gradle流畅整合及问题解决的完整过程与思考 第29讲:Gradle插件问题解决方案与Nodejs环境...
20_通过Apache Thrift实现Java与Python的RPC调用 21_gRPC深入详解 22_gRPC实践 23_Gradle Wrapper在Gradle项目构建中的最佳实践 24_gRPC整合Gradle与代码生成 25_gRPC通信示例与JVM回调钩子 26_gRPC服务器流式调用...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
DotNetty是微软团队参考Java上的Netty开发的网络通信框架,并且保留了Netty原来绝大部分的编程接口。但目前最大的问题是没有官方说明文档,官方示例也仅仅是控制台应用程序,参考价值较低。本项目展示了在WPF中...
基于 Java Web 项目的 SpringBoot 框架初始化模板,该模板整合了常用的框架,保证大家在此...19、基于 Netty 的 WebSocket 全双工通信设计示例 20、对象存储、消息队列、缓存、分布式锁、限流、国际化、网络等工具类
该模块包含一个示例 Bukkit 插件和一个示例 BungeeCord 插件,它们一起形成一个具有基本数据包交换的网络。 建造 所有模块都可以通过在主目录中运行mvn clean package来构建。 minecraft-example 项目将创建一个带...
Tcp服务端与客户端的JAVA实例源代码,一个简单的Java TCP服务器端程序,别外还有一个客户端的程序,两者互相配合可以开发出超多的网络程序,这是最基础的部分。 递归遍历矩阵 1个目标文件,简单! 多人聊天室 3...
Java从网络取得文件 1个目标文件 简单 Java从压缩包中提取文件 1个目标文件 简单 Java存储与读取对象 1个目标文件 如题 Java调色板面板源代码 1个目标文件 摘要:Java源码,窗体界面,调色板 使用Java语言编写的一款...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...
6、支持多种通信框架(Mina/Netty/Grizzly),支持多种序列化/反序列化(Java/Hessian/PB); 7、支持自定义通信协议,可完全替换NFS-RPC自带的协议。 淘宝开放平台JAVA版SDK top4java 设计原则 容易维护扩展(不...