0

java | channel 简介

 1 year ago
source link: https://benpaodewoniu.github.io/2023/01/25/java192/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

channel 简介

姑苏城外一茅屋,万树梅花月满天

channel 的作用。

  • close
    • 关闭 channel
  • closeFuture()
    • 用来处理 channel 的关闭
    • sync 方法作用是同步等待 channel 关闭
    • addListener 方法是异步等待 channel 关闭
  • pipeline
    • 添加处理器
  • write
    • 写入数据
      • 可能由于数据太短,会把数据存到缓冲区内,然后,等待数据很长后,再发送,或者执行 flush() 发送
  • writeAndFlush
    • 将数据写入并刷出

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK