Netty Learning Route Planning

Source: Internet
Author: User

The first step of the first Netty application

    • Service side (Serverchannel)
      • Echoserverhandler simple receive print, return the received message to the sender
      • Flushes all pending messages to the remote node
      • After closing the channel, the operation is completed
    • Service-side (server)
      • Echoserver creating Eventloopgroup, Serverbootstrap
      • Specify Channel
      • Set the socket address to use the selected port
      • Add Echoserverhandler to Channel channelpipeline
      • Bind server; Sync waits for server to close
      • Close the channel and block until it is closed
      • Shut down the Eventloopgroup, release all resources
    • Build process for client , Bootstrap

The second step is familiar with components

    • The learning steps are as follows:
    1. Channel, Channelhandler
    2. Encode, Decode, Bytebuf
    3. Channelhandlercontext
    4. Referencecountutil
    5. Channelfuture, Promise
    6. Channelpipeline, Channelinitializer
    7. EventLoop, Eventloopgroup
    8. Attributekey
    9. Charsetutil

      As far as possible, according to its correspondence in the entire communication process of the CIS, explain all Netty main components. The approximate structure diagram is as follows:

1.Channel, Channelhandler

Be familiar with the usefulness of each method within the Channelinboundhandleradapter abstract class.

Using the single principle of responsibility, the message

2.Encode, Decode, Bytebuf
    • Encode, Decode

    • Bytebuf
      (Bytebuf and related auxiliary classes) [Http://www.cnblogs.com/wade-luffy/p/6196481.html]
      (Wroldclock) [Https://netty.io/4.0/xref/io/netty/example/worldclock/WorldClockServerHandler.html]

The third step is difficult and important
    1. EventLoop number, Name
    2. Sticky bag, half bag
    3. Heartbeat 3 times
    4. reconnects
    5. Session
    6. Don't want to go to keywords
    7. Memory protection, overflow oom
    8. Number of connections and release
    9. Deny connection, blacklist, whitelist
    10. Nginx
    11. Fail over retry and idempotent
Fourth Step High-order principle
    1. Bytebuf
    2. Channel and unsafe
    3. Channelpipeline and Channelhandler
    4. EventLoop and Eventloopgroup
    5. Future and promise

Netty Learning Route Planning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.