Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::requests::impl::WsConnectionImpl< StreamType > Class Template Reference
Inheritance diagram for util::requests::impl::WsConnectionImpl< StreamType >:
Collaboration diagram for util::requests::impl::WsConnectionImpl< StreamType >:

Public Member Functions

 WsConnectionImpl (StreamType ws)
 
std::expected< std::string, RequestErrorread (boost::asio::yield_context yield, std::optional< std::chrono::steady_clock::duration > timeout=std::nullopt) override
 Read a message from the WebSocket.
 
std::optional< RequestErrorwrite (std::string const &message, boost::asio::yield_context yield, std::optional< std::chrono::steady_clock::duration > timeout=std::nullopt) override
 Write a message to the WebSocket.
 
std::optional< RequestErrorclose (boost::asio::yield_context yield, std::chrono::steady_clock::duration const timeout=kDEFAULT_TIMEOUT) override
 Close the WebSocket.
 
- Public Member Functions inherited from util::requests::WsConnection

Additional Inherited Members

- Static Public Attributes inherited from util::requests::WsConnection
static constexpr std::chrono::seconds kDEFAULT_TIMEOUT {5}
 

Member Function Documentation

◆ close()

template<typename StreamType >
std::optional< RequestError > util::requests::impl::WsConnectionImpl< StreamType >::close ( boost::asio::yield_context yield,
std::chrono::steady_clock::duration const timeout = kDEFAULT_TIMEOUT )
inlineoverridevirtual

Close the WebSocket.

Parameters
yieldyield context
timeouttimeout for the operation
Returns
Error if any

Implements util::requests::WsConnection.

◆ read()

template<typename StreamType >
std::expected< std::string, RequestError > util::requests::impl::WsConnectionImpl< StreamType >::read ( boost::asio::yield_context yield,
std::optional< std::chrono::steady_clock::duration > timeout = std::nullopt )
inlineoverridevirtual

Read a message from the WebSocket.

Parameters
yieldyield context
timeouttimeout for the operation
Returns
Message or error

Implements util::requests::WsConnection.

◆ write()

template<typename StreamType >
std::optional< RequestError > util::requests::impl::WsConnectionImpl< StreamType >::write ( std::string const & message,
boost::asio::yield_context yield,
std::optional< std::chrono::steady_clock::duration > timeout = std::nullopt )
inlineoverridevirtual

Write a message to the WebSocket.

Parameters
messagemessage to write
yieldyield context
timeouttimeout for the operation
Returns
Error if any

Implements util::requests::WsConnection.


The documentation for this class was generated from the following file: