总的来说这本书讲的比较浅显,但是对于理解Netty的设计思路很有帮助,里面提到的最佳实践现在已经算是普通实践了
以下是一些读书摘要
ChannelHandlerAdapter also provides the utility method isShareable(). This method returns true if the implementation is annotated as shareable Indicating that it can be added to multiple channelpipelines.
The leak detection level is defined by setting the following Java system property to one of the values in the table :disabled, simple advanced paranoid.
java -Dio.netty.leakDetectLevel=SIMPLE
ChannelPipeline relativity
When you’ve finished adding your mixed of inbound and outbound handlers to a channel pipeline using the channel pipeline.add* method, the ordinal of each channel handler is its position from beginning to end as we just defined them. Thus if you number, the handlers in fingers 6.3 from left to right. The first channel handler seen by a inbound event will be one. The first hand and seen by a outbound event will be fine.
Interface channelHandlerContext.
ChannelHandlerContext has numerous methods, some of which are also present on channel and on channel pipeline itself. But there is an important difference. If you invoke these methods on a channel or channel pipeline instance, they propagate through the entire pipeline, the same methods called on a channel Handler context will start at the current associated channel Handler and propagate only to the next channel handler in the pipeline that is capable of handing the event.