Giter Club home page Giter Club logo

netty-demo's Introduction

Netty 学习


  • 不接受任何请求时发送一个含32位的整数消息,发送完立即关闭
  • 之前的例子都是使用的ByteBuf,这里将使用POJO
  • server 端 TimeEncoder,client 端 TimeDecoder

处理基于流的传输

基于流(stream-based)的传输,如TCP/IP,接收的数据存储在socket的接收buffer,但是这个buffer缓冲不是数据包的队列,而是字节队列,也就是说即使你用两个独立的数据包发送两个消息,操作系统不会将其作为两个消息对待,而是作为一堆的字节来处理。

TCP/IP 通信传输的数据都是基于流传输的(stream-based),单位是数据包(Packet),Packet包含了发送者、接收者的地址信息,这些包沿着不同的路径在一个或多个网络中,经过中继站,最终在目的地重新组合。如果对于一个中继站数据包太大,改数据包就会被分片,被分片成多个小的数据包,规定上在中间节点上不允许对小数据包拼装组合。

主要参考

netty-demo's People

Contributors

elegance avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.