netty概述

Netty是什么

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

netty是一個異步的事件驅(qū)動(不同的階段,對應(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是一個非阻塞的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è)計從一些的協(xié)議比如說FTP,STMP,HTTP和一些基于二進(jìn)制的傳統(tǒng)協(xié)議獲取的經(jīng)驗。因此,Netty成功的發(fā)現(xiàn)一種方式去實現(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

基于靈活的可擴展的時間模型,允許明確的關(guān)注分離.

*Highly customizable thread model - single thread, one or more thread pools such as SEDA

高度可定制的線程模型-單線程,一個或多個線程池比如說SEDA.

SEDA(Staged Event-Driven Architecture)的核心思想是把一個請求處理過程分成幾個Stage,不同資源消耗的Stage使用不同數(shù)量的線程來處理,Stage間使用事件驅(qū)動的異步通信模式。

*True connectionless datagram socket support (since 3.1)

真正的無連接的數(shù)據(jù)報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(可擴展的事件模型),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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容