What is the difference between netty(io.netty.*) and jboss netty(org.jboss.netty.*)

来源:互联网 发布:软件与电子信息工程师 编辑:程序博客网 时间:2024/06/05 08:49

First, in Netty 3.X the packages were from org.jboss.netty.* see: http://netty.io/3.10/api/index.html,

But started Netty 4.X the packeages are from io.netty.* see: http://netty.io/4.0/api/index.html


Now, if you are using Netty 4.X to read message use the method 
ChannelRead(ChannelHandleContext ctx, Object msg) { ... }
inherited from ChannelInboundHandlerAdapter class. 

The method:
messageReceived(ChannelHandlerContext, I) { ...}
was used in Netty 3.X version.


EDIT: Adding @trustin (developer of Netty) comment,
channelRead0 is from SimpleChannelInboundHandler of 4.x, and it will be renamed to messageReceived in Netty 5.


Hope it helps.

原创粉丝点击