-
Notifications
You must be signed in to change notification settings - Fork 634
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
Better document websocket::stream::async_close
and teardown relationship
#2730
Comments
I have a question related to this. When |
What happens to the tcp socket depends on the other side. I think It sends the close frame to the other side, so the server might decide to just drop the connection at this point without a response (unlikely, but possible) in which case you'd get an error from the tcp layer. This would also apply to your second question. But ideally, you'd send the close-frame to the server, which then initialized an ordered teardown, then tears down the ssl layer (which google usually skips) and then closes the socket. |
I have refactored my server logic to not depend on I now also destroy the |
Oops, I think that would violate this note from the
...as the The Asio sockets are more robust in this respect, as calling |
websocket::stream::async_close
are not documentedwebsocket::stream::async_close
and teardown relationship
As requested by the author here, I'm bumping this issue so that the relationship between
|
Version of Beast: Boost 1.83.0
The documentation for
websocket::stream::async_close
does not specify what happens to the underlying TCP socket in both success and error paths (same goes forwebsocket::stream::close
).I'm guessing the teardown customization point has something to do with this, but there is no mention of it in the
async_close
documentation.In particular, I need to know if the underlying TCP socket is closed when
websocket::stream::async_close
completes either successfully or with an error.I know that I can do
if (websocket_.next_layer().is_closed())
in the completion handler to find out at runtime, but I'd still like to know the behavior.ADDENDUM:
websocket::stream::async_close
also does not document whetheris_open() == false
is a postcondition whether or not the operation succeeds. I would expectis_open() == false
to always be a postcondition whether or not it succeeds.The text was updated successfully, but these errors were encountered: