|
Clio
develop
The XRP Ledger API server.
|
Interface for WebSocket connections. It is used to hide SSL and plain connections behind the same interface. More...
#include <WsConnection.hpp>

Public Member Functions | |
| virtual std::expected< std::string, RequestError > | read (boost::asio::yield_context yield, std::optional< std::chrono::steady_clock::duration > timeout=std::nullopt)=0 |
| Read a message from the WebSocket. | |
| virtual std::optional< RequestError > | write (std::string const &message, boost::asio::yield_context yield, std::optional< std::chrono::steady_clock::duration > timeout=std::nullopt)=0 |
| Write a message to the WebSocket. | |
| virtual std::optional< RequestError > | close (boost::asio::yield_context yield, std::chrono::steady_clock::duration timeout=kDEFAULT_TIMEOUT)=0 |
| Close the WebSocket. | |
Static Public Attributes | |
| static constexpr std::chrono::seconds | kDEFAULT_TIMEOUT {5} |
Interface for WebSocket connections. It is used to hide SSL and plain connections behind the same interface.
|
pure virtual |
Close the WebSocket.
| yield | yield context |
| timeout | timeout for the operation |
Implemented in util::requests::impl::WsConnectionImpl< StreamType >, util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::ssl_stream< boost::beast::tcp_stream > > >, and util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::tcp_stream > >.
|
pure virtual |
Read a message from the WebSocket.
| yield | yield context |
| timeout | timeout for the operation |
Implemented in util::requests::impl::WsConnectionImpl< StreamType >, util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::ssl_stream< boost::beast::tcp_stream > > >, and util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::tcp_stream > >.
|
pure virtual |
Write a message to the WebSocket.
| message | message to write |
| yield | yield context |
| timeout | timeout for the operation |
Implemented in util::requests::impl::WsConnectionImpl< StreamType >, util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::ssl_stream< boost::beast::tcp_stream > > >, and util::requests::impl::WsConnectionImpl< boost::beast::websocket::stream< boost::beast::tcp_stream > >.
|
staticconstexpr |
Default timeout for connecting