Proficient in netty framework

• Introduction to Netty
• Why use non-blocking IO (NIO)
• Comparison of blocking IO (blocking IO) and non-blocking IO (non-blocking IO)
• Java NIO problems and solutions in
        Netty Netty is based on Java NIO Web Application Framework, if you are new to Java networking, then this chapter will be your starting point for learning Java web applications; for experienced developers, this chapter is also a good refresher. If you are familiar with NIO and NIO2, you can always skip this chapter and start directly from Chapter 2. Run the Netty server and client written in Chapter 2 on your machine.
        Netty is a NIO client-server (client-server) framework. Using Netty, you can quickly develop network applications, such as server and client protocols. Netty provides a new way to develop network applications that makes it easy to use and highly extensible. Netty's internal implementation is complex, but Netty provides an easy-to-use API to decouple business logic from network processing code. Netty is completely implemented based on NIO, so the entire Netty is asynchronous.
        Network applications usually require high scalability, whether Netty or other Java NIO-based frameworks will provide scalable solutions. A key component of Netty is its asynchronous nature. This chapter will discuss both synchronous (blocking) and asynchronous (non-blocking) IO to illustrate why asynchronous code is used to solve scalability problems and how to use asynchronous.
        For readers who are new to networking, this chapter will help you understand networking applications and how Netty implements them. It explains how to use the basic Java Networking API, discusses the advantages and disadvantages of the Java Networking API and explains how Netty solves problems in Java, such as Eploo errors or memory leaks.
        By the end of this chapter, you'll understand what Netty is and what Netty provides, and you'll understand Java NIO and asynchronous processing mechanisms, and you'll gain that understanding through other chapters in this book.
1.1 Why use Netty?
        David John Wheeler said "All problems in computer science can be solved by indirect methods." As a NIO client-server framework, Netty provides such an indirect solution. Netty provides high-level abstractions to simplify programming TCP and UDP servers, but you can still use the low-level API.
        (David John Wheeler has a famous saying "Any problem in computer science can be solved by adding a layer of logic", this principle is widely used in various fields of computer technology)
1.1.1 Not all network frameworks are the same
        Netty's "quick and easy" does not mean that the performance and maintainability of the programs written will suffer. The experience gained from protocols implemented in Netty such as FTP, SMTP, HTTP, WebSocket, SPDY, and various binary and text-based legacy protocols led Netty's founders to be very careful in its design. Netty successfully provides easy development, high performance and high stability, and strong scalability.
        High profile companies and open source projects such as RedHat, Twitter, Infinispan, and HornetQ, Vert.x, Finagle, Akka, Apache Cassandra, Elasticsearch, and others have contributed to the development of Netty, and some of Netty's features are also needed by these projects caused. Over the years, Netty has become more widely known as the framework of choice for Java networking, and can be found in some open source or non-open source projects. And, Netty won the Duke's Choice Award in 2011 (Duke's Choice Award).
        Additionally, in 2011, Netty founder Trustion Lee left RedHat to join Twitter, at which point the Netty Project Awards became a separate project organization. Both RedHat and Twitter use Netty, so it should come as no surprise. Two companies, RedHat and Twitter, were the largest contributors at the time of writing. There are more and more projects using Netty, and Netty's user groups and projects, as well as the Netty community, are very active.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326178847&siteId=291194637