I am currently trying to implement an async Websocket Client. My timeout options are set in the following way to enable automatic ping pong. However I struggle to find a way to define the ping payload message. Are there any ways to achieve that? Also are there anyways to set how frequent the ping messages are sent out from my side?
Below is code snippet that I tried to set the ping pong options
namespace beast = boost::beast; // from <boost/beast.hpp>
namespace http = beast::http; // from <boost/beast/http.hpp>
namespace websocket = beast::websocket; // from <boost/beast/websocket.hpp>
namespace net = boost::asio; // from <boost/asio.hpp>
namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp>
using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
websocket::stream<beast::ssl_stream<beast::tcp_stream>> ws
websocket::stream_base::timeout timeoutOpt{
std::chrono::seconds(10), // handshake timeout
std::chrono::seconds(20), // idle timeout. Any ways to set the ping interval as well?
true //enable ping-pong to keep alive
};
m_ws.set_option(timeoutOpt);