Replies: 1 comment
-
我想我有点理解了 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
之前我看硕神的书handleClose逻辑是这样
此时handleClose的职责可以很好理解,就是负责调用closeCallback_(甚至我认为channel_->disableAll()只在TcpConnection::connectDestroyed() 这里面做就可以了)
而最新版TcpConnection::handleClose是这样
可以看到原本应该TcpConnection::connectDestroyed() 做的setState, 执行用户回调connectionCallback_ 和channel_->diaableAll() 提前让handleClose执行了
这让我感觉有些困惑,因为这些操作完全可以等到TcpConnection::connectDestroyed()里面来做
请问各位大神这样的设计的目的是什么
Beta Was this translation helpful? Give feedback.
All reactions