1
wowo243 2018 年 7 月 11 日 via Android
同好奇
|
2
SparkMan 2018 年 7 月 11 日
你先看看 Netty 权威指南,估计你看书后就不会来问这种问题了
|
3
mortonnex 2019 年 2 月 14 日 挖个坟
个人觉得 https://stackoverflow.com/questions/22354135/in-netty4-why-read-and-write-both-in-outboundhandler 这里面的回答非常好, outboundHandler 可以理解为人为的外部操作, 而 netty 启动的时候,如果没有设置 autoRead, 那么 netty 不会去 read,所以这时候需要认为"驱动"netty 去 read, 所以 outboundHandler 里面有 read 方法,这个方法传递到最后其实是 header, 然后会注册 interestOps 为 OP_READ,从而监听读事件 同时注意:netty 在每完成一次读之后,都会 removeReadOp() |