Chapter 4 -Netty Overview

table of Contents

1. The presence of native NIO problem

  • NIO libraries and AIP complicated, cumbersome to use: the need to master Selector, ServerSocketChannel, SocketChannel, ByteBuffer and so on.

  • Other need to have additional skills: to be familiar with Java multi-threaded programming, because NIO programming related to the Reactor mode, you must be very familiar with multithreading and network programming, in order to prepare high-quality NIO program.

  • Development effort are very large and difficult: for example, a client face reconnect disconnected, network glitches, half a pack reader, a cache failure, network congestion and processing abnormal flow, and the like.

  • The JDK NIO bug: e.g. notorious Epoll Bug, polling can lead Selector empty, resulting in 100% CPU. Until JDK 1.7 version of the problem still exists, it has not been fundamentally resolved.

     

2.Netty official website explained

Official website: https://netty.io/

Netty is an asynchronous event-driven network application framework
for rapid development of maintainable high performance protocol servers & clients.

Netty is provided by a JBoss open source Java framework, Netty provides asynchronous, web-based event-driven application framework for rapid development of high-performance, high-reliability network IO program. Netty can help you quickly and easily develop a network application, the equivalent NIO simplified development process.

Netty is the most popular NIO framework, Netty in the Internet field, big data distributed computing, game industry, communications industry, such as access to a wide range of applications, known Elasticsearch, inside the framework of Dubbo have adopted Netty.

 

3.Netty advantage

  • Elegant design: for a variety of types of transmission unified API blocking and non-blocking Socket; based on a flexible and extensible event model, clearly separating concerns; highly customizable threading model - a single thread, one or more threads pool.

  • Easy to use: Detailed javadoc, user guide and examples; no other dependencies, JDK5 (netty 3.x) or 6 (netty 4.x) is sufficient.

  • Performance, higher throughput: lower latency; reduce resource consumption; minimize unnecessary resource copy.

  • Security: full SSL / TLS and StartTLS support.

  • Community activists, constantly updated: community activists, short version iterations, bug discovered in time can be repaired, while more new features are added.

 

4.Netty Imprint

Netty version is divided into netty 3.x and netty 4.x, netty 5.x

netty 5 official website has been abandoned, the current stable version is recommended Netty 4.x of.

Currently the official website downloadable version netty 3.x, netty 4.0.x, netty 4.1.x.

Guess you like

Origin www.cnblogs.com/yeyang/p/12578713.html
Recommended