Questions tagged [boost-beast-websocket]

25 questions
4
votes
2 answers

Can beast be used with C++20's co_await keyword?

C++20 introduced language support for coroutines. My understanding is that that this consists of syntactic sugar, such as co_await and co_return, to which semantic meaning is attached via special "hooks". The language support allows for idiomatic…
seertaak
  • 1,087
  • 1
  • 9
  • 17
3
votes
1 answer

Understand the usage of strand without locking

Reference: websocket_client_async_ssl.cpp strands Question 1> Here is my understanding: Given a few async operations bound with the same strand, the strand will guarantee that all associated async operations will be executed as a strictly…
q0987
  • 34,938
  • 69
  • 242
  • 387
3
votes
1 answer

boost async ws server checking client information

How do i check client information as user-agent from boost async web socket server ? I have checked: https://www.boost.org/doc/libs/develop/libs/beast/example/websocket/server/async/websocket_server_async.cpp It was my only referance.
SASA
  • 41
  • 4
3
votes
1 answer

How can I get the data inside a beast::flat_buffer?

I'm connecting to a websocket using the boost/beast libraries and writing the data into a beast::flat_buffer. My issue is that I'm having trouble getting the data from buffer. I have a thread-safe channel object that I can to write to, but I'm not…
Calvin K
  • 104
  • 2
  • 9
2
votes
1 answer

Boost::beast how to close a (sync) reading websocket?

tl;dr: Is there a way to close a WebSocket that's currently doing (sync) read() operation, if server sends nothing for some time? I wanted to make a simple WebSocket client with Boost::beast. When I realized that read() is a blocking operation, and…
Latawiec
  • 341
  • 2
  • 10
2
votes
1 answer

Compilation Error due to Boost::Asio::Spawn function

RE: https://www.boost.org/doc/libs/1_80_0/libs/beast/example/websocket/client/coro-ssl/websocket_client_coro_ssl.cpp I tried following the above example and ran into a compilation error; namely, code C2039: 'type': is not a member of…
2
votes
0 answers

Boost beast read: The WebSocket control frame was fragmented

While I am trying the code from: advanced_server example I am getting following error here: read: The WebSocket control frame was fragmented The client is sending ping control message using Poco framework. The payload is of zero bytes length. What…
monotosh
  • 21
  • 1
2
votes
1 answer

Is there any way to subscribe and to listen feed in boost beast websocket?

I am using an example from boost beast documentation for async websocket client. The to send some command to subscribe and then to listen feed until it is terminated manually (preferably with other function or else) Standard examples aren't applied…
1
vote
1 answer

Does a coroutine call boost::asio::write block the current thread?

When the coroutine calls boost::asio::write, the coroutine will block waiting for the buffer to become writable or the coroutine will be scheduled out because the tcp buffer is full?
qing zhao
  • 23
  • 2
1
vote
0 answers

c++ gemini websocket connection. error uninitialized

I am trying to create a basic vanilla websocket client using c++ and the boost/beast library. Following the examples, I can create an unsecured ws connection. But when I try to incorporate ssl into the mix, everything falls apart. It fails during…
1
vote
0 answers

boost::beast reconnect websocket after close

I'm messing around with the beast async websocket client and want it to re-connect in the same session instance if it becomes disconnected. The issue is that everything works until I attempt the websocket handshake a second time following disconnect…
darnell_a
  • 61
  • 8
1
vote
1 answer

IO Context is not running in separate threads

I am trying to run a Kraken websocket client for two symbols, AUD/USD and AUD/JPY, in separate IOContexts in separate threads, using C++ and the Boost.Beast library. I have 6 cores available and want to run each symbol in a separate thread. However,…
1
vote
1 answer

How to send websocket message while waiting to receive?

My goal is to register to a websocket service to get real-time company quotations. So I based my code on the following example, by mostly calling (again) async_read, once we receive a quotation to accept futures…
1
vote
0 answers

Boost Beast Websocket: Application Data After Close Notify

I am using boost::beast as well as boost::asio to implement a websocket client with SSL support. My WebsocketClient class has the following members: boost::asio::io_context& io_context; boost::asio::ssl::context& ssl_context; …
singular
  • 13
  • 3
1
vote
1 answer

Do I need to call async_shutdown on beast::ssl_stream when experience issues?

https://www.boost.org/doc/libs/1_72_0/libs/beast/example/http/client/async-ssl/http_client_async_ssl.cpp std::unique_ptr resolver_{nullptr}; std::unique_ptr> stream_{nullptr}; void…
q0987
  • 34,938
  • 69
  • 242
  • 387
1
2