mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-02 08:09:35 +02:00
Fix wss reconnect
This commit is contained in:
parent
054706e608
commit
a407e68df6
3 changed files with 112 additions and 54 deletions
|
@ -37,6 +37,8 @@
|
|||
// standard headers
|
||||
#include <deque>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
|
||||
|
@ -235,10 +237,15 @@ private:
|
|||
boost::system::error_code doConnect(boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> endpoint) override;
|
||||
void write(boost::asio::streambuf& buffer, WriteHandler&& write_handler) override;
|
||||
|
||||
/// @return the websocket
|
||||
tcp_websocket& getWs();
|
||||
|
||||
/// TCP web socket
|
||||
tcp_websocket tcp_ws_;
|
||||
std::optional<tcp_websocket> tcp_ws_;
|
||||
/// Receive buffer
|
||||
boost::beast::flat_buffer buffer_;
|
||||
/// protect ssl_ws_
|
||||
std::mutex ws_mutex_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -260,8 +267,15 @@ private:
|
|||
boost::system::error_code doConnect(boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> endpoint) override;
|
||||
void write(boost::asio::streambuf& buffer, WriteHandler&& write_handler) override;
|
||||
|
||||
/// @return the websocket
|
||||
ssl_websocket& getWs();
|
||||
|
||||
/// SSL context
|
||||
boost::asio::ssl::context& ssl_context_;
|
||||
/// SSL web socket
|
||||
ssl_websocket ssl_ws_;
|
||||
std::optional<ssl_websocket> ssl_ws_;
|
||||
/// Receive buffer
|
||||
boost::beast::flat_buffer buffer_;
|
||||
/// protect ssl_ws_
|
||||
std::mutex ws_mutex_;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue