Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-7 votes
1 answer
62 views

Cannot include Beast library in C++ [closed]

I want to use websockets in a c++ project. For this I am using boost library. I ma currently unable to import the library. I have added the path in environment variable if i try to run the code this ...
Reyan Ahtesham's user avatar
1 vote
0 answers
73 views

how to write and read at the same time in boost ssl web socket server?

Currently I'm using codes of this link text and in on_read I call a function which sends some string data multiple times in a loop, using ws_write(). The problem is that I can not read from the same ...
Rasoul.A's user avatar
0 votes
0 answers
543 views

Is it possible to connect a c++ boost beast/asio websocket to a socket.io server in nodejs?

I've been struggling to get a basic application going where I use boost to attempt to connect to a local webserver hosted on nodejs using express and socket.io. the idea is to host a socket server and ...
Captain Dando's user avatar
0 votes
0 answers
300 views

C++ boost beast websocket crash after running a while

I am using boost beast to connect to a server's websocket. I only rewrite the on_read function in order to make the websocket never disconnect, the other parts are just copied from beast example code. ...
Kevin Yin's user avatar
0 votes
1 answer
1k views

How to handle ping request on client (boost::beast::websocket)

Imagine that you have some websocket client, that downloading some data in loop like this: #include <boost/asio.hpp> #include <boost/beast.hpp> #include "nlohmann/json.hpp" ...
Shamil Mukhetdinov's user avatar
1 vote
1 answer
163 views

Parsing json inside lambda function passed as handler function in async_read is causing json parsing error

#define BINANCE_HANDLER(f) beast::bind_front_handler(&binanceWS<A>::f, this->shared_from_this()) template <typename A> class binanceWS : public std::enable_shared_from_this<...
noobie's user avatar
  • 25
2 votes
1 answer
538 views

Should I clean up beast::flat_buffer when I see errors on on_read?

http_client_async_ssl class session : public std::enable_shared_from_this<session> { ... beast::flat_buffer buffer_; // (Must persist between reads) http::response<http::...
q0987's user avatar
  • 36.1k
0 votes
1 answer
234 views

Reacting to each tick events from the websocket

I would like to design my trading system reacting to each tick events from the websocket stream i subscribed to. So basically i have two options : void WebsocketClient::on_write(beast::error_code ec, ...
dopller's user avatar
  • 361
1 vote
1 answer
318 views

reduce response time while using async cpp boost socket

i've created an async beast server that gets a request from a browser, opens a second socket , writes the request , gets the response and sends it back to the browser. all async . as the "send ...
redemption's user avatar
1 vote
1 answer
501 views

How to find if the 'target' for websocket::stream::async_handshake() is not found?

For HTTP calls, you can do: http::async_read(m_stream, m_buffer, m_res, beast::bind_front_handler(&RestSession::on_read, shared_from_this())); // ... then void on_read(beast::error_code ec, std::...
subatomicdev's user avatar
2 votes
0 answers
481 views

Using boost::beast::websocket to send http post request

I've got the following class member boost::beast::websocket::stream<boost::beast::tcp_stream> ws_; which gets instantiated on class c'tor using boost::asio::io_service as parameter. I assume ...
Zohar81's user avatar
  • 5,150
0 votes
1 answer
713 views

How to use boost::beast to connect to Coinbase's websocket API

I'm a bit new to websocket programming. I've been trying to use this example :- https://www.boost.org/doc/libs/develop/libs/beast/example/websocket/client/async-ssl/websocket_client_async_ssl.cpp to ...
owagh's user avatar
  • 3,528
0 votes
1 answer
1k views

boost websocket and io_context reusability for reestablishability of a connection

I have writted a small websocket client using boost::beast::websocket and boost::asio::io_context in C++. I am having a state machine with following states: enum class State { GDR_PROVISING, ...
abhiarora's user avatar
  • 10.5k
1 vote
0 answers
386 views

Implement publish/subscribe with Boost Beast

I have a Websocket server based on Boost Beast and I want to implement a publish / subscribe pattern. My current code base is based on the advanced/flex example. Is there a recipe / pattern on how to ...
benjist's user avatar
  • 2,891
4 votes
1 answer
6k views

Boost-beast websocket handshake problems

I am attempting to set up a websocket connection with a remote server and get the following error: The WebSocket handshake was declined by the remote peer I am following this example: https://www....
Abhinav Boyed's user avatar

15 30 50 per page