Mohammad Nejati

Results 144 comments of Mohammad Nejati

You need to provide an overload of the function [beast_close_socket](https://www.boost.org/doc/libs/1_85_0/libs/beast/doc/html/beast/ref/boost__beast__beast_close_socket.html) too: ```C++ void beast_close_socket(NextLayerImpl_&) { } ```

The Handler is not a regular function object; it is an Asio [Completion Token](https://www.boost.org/doc/libs/develop/doc/html/boost_asio/overview/model/completion_tokens.html). You can only use it through [async_initiate](https://www.boost.org/doc/libs/develop/doc/html/boost_asio/reference/async_initiate.html). You can use [any_completion_handler](https://www.boost.org/doc/libs/develop/doc/html/boost_asio/reference/any_completion_handler.html) for type-erasing the handler, but...

You can easily use a different socket type for the underlying stream of `websocket::stream`: ```C++ using ws_stream_t = beast::websocket::stream; ``` The [`websocket::stream::next_layer`](https://www.boost.org/doc/libs/develop/libs/beast/doc/html/beast/ref/boost__beast__websocket__stream/next_layer/overload2.html) function gives you access to the underlying stream,...

Do they happen at the end of stream? [error::stream_truncated](https://www.boost.org/doc/libs/develop/libs/beast/doc/html/beast/using_io/ssl_tls_shutdown.html#beast.using_io.ssl_tls_shutdown.error_stream_truncated)

Are you sure it’s not the server that dropped the connection? Does this happen with just one specific server?

Do you mean `load_root_certificates`? it calls [ssl::context::add_certificate_authority](https://www.boost.org/doc/libs/1_86_0/doc/html/boost_asio/reference/ssl__context/add_certificate_authority.html) which is not thread safe.

Do they have their own `ssl::context` too?

Have you tried reducing your application to a single connection and a single thread to see if the issue still exists? If possible, test one of the existing examples.

First, you need to read the initial HTTP upgrade request (just like a regular http request) and inspect the request target. Then, use this overload of `async_accept` to continue the...

It's difficult to determine the issue without seeing the code. Please check if the client successfully completes the SSL handshake. If you receive the HTTP upgrade request separately, use this...