roar
|
#include <websocket_client.hpp>
Classes | |
struct | ConnectParameters |
struct | ConstructionArguments |
struct | Implementation |
Public Member Functions | |
WebsocketClient (ConstructionArguments &&args) | |
~WebsocketClient () | |
WebsocketClient (WebsocketClient &&)=delete | |
WebsocketClient & | operator= (WebsocketClient &&)=delete |
WebsocketClient (WebsocketClient const &)=delete | |
WebsocketClient & | operator= (WebsocketClient const &)=delete |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen<>, Detail::PromiseTypeBindFail< Error > > | connect (ConnectParameters &&connectParameters) |
Connects the websocket to a server. | |
Public Member Functions inherited from Roar::Detail::SharedFromBase< WebsocketBase, WebsocketClient > | |
std::shared_ptr< WebsocketClient > | shared_from_this () |
Public Member Functions inherited from Roar::WebsocketBase | |
WebsocketBase (std::variant< Detail::StreamType, boost::beast::ssl_stream< Detail::StreamType > > &&stream) | |
WebsocketBase (std::variant< boost::beast::websocket::stream< boost::beast::ssl_stream< Detail::StreamType > >, boost::beast::websocket::stream< Detail::StreamType > > &&ws) | |
WebsocketBase (WebsocketBase &&)=delete | |
WebsocketBase & | operator= (WebsocketBase &&)=delete |
WebsocketBase (WebsocketBase const &)=delete | |
WebsocketBase & | operator= (WebsocketBase const &)=delete |
virtual | ~WebsocketBase () |
template<typename FunctionT > | |
auto | withStreamDo (FunctionT &&func) |
template<typename FunctionT > | |
auto | withStreamDo (FunctionT &&func) const |
void | readMessageMax (std::size_t amount) |
Set the maximum incoming message size option. | |
std::size_t | readMessageMax () const |
Returns the maximum incoming message size setting. | |
void | binary (bool enable) |
Enable/Disable binary for next send message. | |
bool | binary () const |
Returns true if the binary message write option is set. | |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen< std::size_t >, Detail::PromiseTypeBindFail< Error const & > > | send (std::string message) |
Sends a string to the server. | |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen< WebsocketReadResult >, Detail::PromiseTypeBindFail< Error const & > > | read () |
Reads something from the server. | |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen< WebsocketReadResult >, Detail::PromiseTypeBindFail< Error const & > > | read_some (std::size_t limit=4096) |
Reads something from the server. | |
void | autoFragment (bool enable) |
Set the automatic fragmentation option. | |
bool | autoFragment () const |
Returns true if the automatic fragmentation option is set. | |
bool | close (std::chrono::seconds closeWaitTimeout=std::chrono::seconds{3}) |
Closes the websocket connection. | |
Static Public Attributes | |
static constexpr std::chrono::seconds | defaultTimeout {10} |
Private Attributes | |
std::unique_ptr< Implementation > | impl_ |
Additional Inherited Members | |
Protected Attributes inherited from Roar::WebsocketBase | |
std::variant< boost::beast::websocket::stream< boost::beast::ssl_stream< Detail::StreamType > >, boost::beast::websocket::stream< Detail::StreamType > > | ws_ |
Roar::WebsocketClient::WebsocketClient | ( | ConstructionArguments && | args | ) |
|
default |
|
delete |
|
delete |
Detail::PromiseTypeBind< Detail::PromiseTypeBindThen<>, Detail::PromiseTypeBindFail< Error > > Roar::WebsocketClient::connect | ( | ConnectParameters && | connectParameters | ) |
Connects the websocket to a server.
connectParameters | see ConnectParameters |
|
delete |
|
delete |
|
staticconstexpr |
|
private |