Netty是什么
Netty is?an asynchronous event-driven network application framework?for rapid development of maintainable high performance protocol servers & clients.
netty是一個(gè)異步的事件驅(qū)動(dòng)(不同的階段家乘,對應(yīng)不同的回調(diào)方法)的網(wǎng)絡(luò)框架維護(hù)著高性能協(xié)議的服務(wù)器端和客戶端的快速開發(fā)。
Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and streamlines network programming such as TCP and UDP socket server.
Netty是一個(gè)非阻塞的io客戶端服務(wù)端的框架可以快速并且簡單的開發(fā)網(wǎng)絡(luò)應(yīng)用比如說客戶端和服務(wù)端的協(xié)議。它極大的簡化了網(wǎng)絡(luò)編程流程比如說tcp或者udp socket服務(wù)器突委。
'Quick and easy' doesn't mean that a resulting application will suffer from a maintainability or a performance issue. Netty has been designed carefully with the experiences earned from the implementation of a lot of protocols such as FTP, SMTP, HTTP, and various binary and text-based legacy protocols. As a result, Netty has succeeded to find a way to achieve ease of development, performance, stability, and flexibility without a compromise.
快速和簡單并不意味著由此產(chǎn)生的應(yīng)用程序?qū)⒁馐艿娇删S護(hù)性或者性能問題的困擾滥沫。Netty精簡的設(shè)計(jì)從一些的協(xié)議比如說FTP对人,STMP涛舍,HTTP和一些基于二進(jìn)制的傳統(tǒng)協(xié)議獲取的經(jīng)驗(yàn)暂筝。因此箩言,Netty成功的發(fā)現(xiàn)一種方式去實(shí)現(xiàn)輕松的開發(fā),性能焕襟,穩(wěn)定和靈妥協(xié)陨收。活性而不需要任何的.
Features
Design
*Unified API for various transport types - blocking and non-blocking socket
統(tǒng)一的api基于不同的傳輸類型-阻塞和非阻塞的socket.
*Based on a flexible and extensible event model which allows clear separation of concerns
基于靈活的可擴(kuò)展的時(shí)間模型鸵赖,允許明確的關(guān)注分離.
*Highly customizable thread model - single thread, one or more thread pools such as SEDA
高度可定制的線程模型-單線程务漩,一個(gè)或多個(gè)線程池比如說SEDA.
SEDA(Staged Event-Driven Architecture)的核心思想是把一個(gè)請求處理過程分成幾個(gè)Stage拄衰,不同資源消耗的Stage使用不同數(shù)量的線程來處理,Stage間使用事件驅(qū)動(dòng)的異步通信模式菲饼。
*True connectionless datagram socket support (since 3.1)
真正的無連接的數(shù)據(jù)報(bào)socket支持(基于3.1版本).
Ease of use
*Well-documented Javadoc, user guide and examples
詳細(xì)的用戶java文檔肾砂,用戶指南和demo
*No additional dependencies, JDK 5 (Netty 3.x) or 6 (Netty 4.x) is enough
不需要額外的依賴列赎,JDK 5 (Netty 3.x版本) 或者 6 (Netty 4.x版本)就足夠了
Note: Some components such as HTTP/2 might have more requirements. Please refer to?the Requirements page?for more information.
注意:一些組件比如說HTTP/2可能需要一些額外的依賴宏悦。
Performance
*Better throughput, lower latency
更好的吞吐量,低延遲
*Less resource consumption
資源消耗減少
*Minimized unnecessary memory copy
不必要的內(nèi)存拷貝(零拷貝).
Security
*Complete SSL/TLS and StartTLS support
完全的SSl/tls 和 StartTLS的支持包吝。
1饼煞、core(核心模塊):Extensible Event Model(可擴(kuò)展的事件模型),Universal Communication API(通用的通訊API),Zero-Copy-Capable Rich Byte Buffer(零拷貝的字節(jié)緩沖區(qū))
2、Transport Services(傳輸服務(wù)): Socket & Datagram,HTTp Tunnel,In-Vm Pipe
3诗越、Protocol Support(協(xié)議支持): HTTP & WebSocket,SSl.StartTLS,Google Protobuf,zlib/gzip Compression,Large File Transfer,RTSP(和流媒體有關(guān)),Legacy Text.Binary Protocols with Unit Testability