Replies: 2 comments
-
|
这个在我以前的视频课里讲过: https://youtu.be/XfPR69Q4IyM |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
真心感谢硕哥指导。 |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
服务端read为0时调用handleClose,最终会把自己从map中移除,如果TcpConnection的引用计数为0那么会调用析构最终close fd。我的问题是如果客户端只调用了shutdown write,但对服务端来说通道仍然是可写的吧,为啥服务端不先shutdown read而是close呢?我的猜想是如果服务端仍有数据,那么由用户在socket关闭之前的connection的回调里去发送,发送完用户可以shutdown也可以不shutdown,反正最终socket都会被关闭,不知道我的想法对不对?
Beta Was this translation helpful? Give feedback.
All reactions