Netty4.x 用户指南 - 前言

User guide for 4.x

Preface

The Problem

Nowadays we use general purpose applications or libraries to communicate with each other. For example, we often use an HTTP client library to retrieve information from a web server and to invoke a remote procedure call via web services. However, a general purpose protocol or its implementation sometimes does not scale very well. It is like how we don’t use a general purpose HTTP server to exchange huge files, e-mail messages, and near-realtime messages such as financial information and multiplayer game data. What’s required is a highly optimized protocol implementation that is dedicated to a special purpose. For example, you might want to implement an HTTP server that is optimized for AJAX-based chat application, media streaming, or large file transfer. You could even want to design and implement a whole new protocol that is precisely tailored to your need.

Another inevitable case is when you have to deal with a legacy proprietary protocol to ensure the interoperability with an old system. What matters in this case is how quickly we can implement that protocol while not sacrificing the stability and performance of the resulting application.

前言

问题

现在我们使用通用应用程序或库来相互通信。例如,我们经常使用HTTP客户端库从Web服务器检索信息并通过Web Service调用远程过程调用(remote procedure call、RPC)。然而,通用协议或其实现有时不能很好扩展。这就好比我们不使用通用HTTP服务器来交换巨大的文件,电子邮件和接近实时的消息,例如金融信息和多人游戏数据。所需要的是高度优化的专用于特殊用途的协议实现。例如,你可能想要实现一个针对基于AJAX的聊天应用程序,媒体流或大文件传输进行优化的HTTP服务器。你甚至可以设计和实现一个完全根据你的需要量身定制的新协议。
另一个不可避免的情况是,你必须处理传统专有协议以确保与老系统的互通性。在这种情况下,重要的是我们可以快速地实现该协议,同时不会牺牲最终应用程序的稳定性和性能。

The Solution

The Netty project is an effort to provide an asynchronous event-driven network application framework and tooling for the rapid development of maintainable high-performance · high-scalability protocol servers and clients.

In other words, Netty is an NIO client server framework that 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 development.

‘Quick and easy’ does not 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.

Some users might already have found other network application framework that claims to have the same advantage, and you might want to ask what makes Netty so different from them. The answer is the philosophy it is built on. Netty is designed to give you the most comfortable experience both in terms of the API and the implementation from the day one. It is not something tangible but you will realize that this philosophy will make your life much easier as you read this guide and play with Netty.

解决方案

Netty项目旨在为快速开发可维护、高性能、高可扩展协议服务端和客户端提供异步事件驱动的网络应用程序框架和工具。

换句话说,Netty是一个NIO 客户端服务端框架,使用Netty可以快速并且容易开发网络应用程序,例如服务端和客户端协议。它极大的简化了网络编程,例如TCP和UDP套接字服务器。

”快速和简单“并不意味着产生的应用程序会受到可维护性和性能问题。Netty已经通过实现许多协议(如FTP,SMTP,HTTP以及各种二级制和基于文本的传统协议)获得的经验进行了精心的设计。Netty已经成功的找到了一种方式实现易于开发,高性能,高稳定性和灵活性,而不需要妥协。

一些用户可能已经找到其他宣称具有相同优势的网络应用框架,你可能想问Netty与他们有何不同之处。答案是它所基于的哲学,Netty旨在为您提供最舒适的体验,无论是在API方面还是在实现方面。这不是有形的,但你会意识到当你阅读本指南时,这一哲学将使你的生活变得更加轻松。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值