#include <websocket_base.hpp>
◆ WebsocketBase() [1/4]
◆ WebsocketBase() [2/4]
Roar::WebsocketBase::WebsocketBase |
( |
std::variant< boost::beast::websocket::stream< boost::beast::ssl_stream< Detail::StreamType > >, boost::beast::websocket::stream< Detail::StreamType > > && |
ws | ) |
|
◆ WebsocketBase() [3/4]
◆ WebsocketBase() [4/4]
◆ ~WebsocketBase()
Roar::WebsocketBase::~WebsocketBase |
( |
| ) |
|
|
virtualdefault |
◆ autoFragment() [1/2]
bool Roar::WebsocketBase::autoFragment |
( |
| ) |
const |
Returns true if the automatic fragmentation option is set.
- Returns
- true yes is set
-
false no is not.
◆ autoFragment() [2/2]
void Roar::WebsocketBase::autoFragment |
( |
bool |
enable | ) |
|
Set the automatic fragmentation option.
- Parameters
-
enable | true = automatic fragmentation, false = no automatic fragmentation. |
◆ binary() [1/2]
bool Roar::WebsocketBase::binary |
( |
| ) |
const |
Returns true if the binary message write option is set.
- Returns
- true binary is set.
-
false binary is not set.
◆ binary() [2/2]
void Roar::WebsocketBase::binary |
( |
bool |
enable | ) |
|
Enable/Disable binary for next send message.
- Parameters
-
enable | true = binary yes, false = binary no. |
◆ close()
bool Roar::WebsocketBase::close |
( |
std::chrono::seconds |
closeWaitTimeout = std::chrono::seconds{3} | ) |
|
Closes the websocket connection.
- Returns
- true Returns true when the timeout was not reached.
-
false Returns false when the timeout was reached.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read()
Reads something from the server.
- Returns
- A promise to continue after reading
◆ read_some()
Reads something from the server.
- Parameters
-
limit | A limit on how much to read. |
- Returns
- A promise to continue after reading
◆ readMessageMax() [1/2]
std::size_t Roar::WebsocketBase::readMessageMax |
( |
| ) |
const |
Returns the maximum incoming message size setting.
- Returns
- std::size_t
◆ readMessageMax() [2/2]
void Roar::WebsocketBase::readMessageMax |
( |
std::size_t |
amount | ) |
|
Set the maximum incoming message size option.
- Parameters
-
◆ send()
Sends a string to the server.
- Parameters
-
message | A message to send. |
- Returns
- A promise that is called with the amount of bytes sent, Promise::fail with a Roar::Error.
◆ withStreamDo() [1/2]
template<typename FunctionT >
auto Roar::WebsocketBase::withStreamDo |
( |
FunctionT && |
func | ) |
|
|
inline |
◆ withStreamDo() [2/2]
template<typename FunctionT >
auto Roar::WebsocketBase::withStreamDo |
( |
FunctionT && |
func | ) |
const |
|
inline |
◆ ws_
The documentation for this class was generated from the following files: