-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename shutdown method on {Tcp,Unix}Stream to shutdown_std and make it private, to avoid clash with AsyncWriteExt::shutdown #3298
Conversation
…yncWriteExt Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
…syncWriteExt Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 👍
I think is should be mentioned in docs how one can achieve Read and Both shutdown behaviors. |
With this change, that isn't possible. However @carllerche suggested on Discord to an Note that the behavior of |
@MikailBag what do you expect happens when shutdown(Read) is called? |
I've never used shutdown() so I can't answer this question. But I think someone else used them. IMHO it'd be good to provide some docs to them, such as "shutdown(Read) is never correct, fix your code" or "use this function", or something else. This is just an opinion, feel free to ignore :) |
Motivation
#3294 describes that the shutdown method should be removed from the {Tcp,Unix}Stream types in favour of the one on AsyncWriteExt. However, plain removing it lead to some compilation failures that were difficult to resolve, so @Darksonn suggested we instead rename the method (to shutdown_std) and make it private. Closes #3294.
Solution
Rename {Tcp,Unix}Stream::shutdown to shutdown_std and make it private.