REDAC HybridController
Firmware for LUCIDAC/REDAC Teensy
Loading...
Searching...
No Matches
websockets::WebsocketsClient Class Reference

#include <client.h>

Public Member Functions

 WebsocketsClient ()
 
 WebsocketsClient (std::shared_ptr< network::TcpClient > client)
 
 WebsocketsClient (const WebsocketsClient &other)
 
 WebsocketsClient (const WebsocketsClient &&other)
 
WebsocketsClientoperator= (const WebsocketsClient &other)
 
WebsocketsClientoperator= (const WebsocketsClient &&other)
 
void addHeader (const std::string key, const std::string value)
 
void onMessage (const MessageCallback callback)
 
void onMessage (const PartialMessageCallback callback)
 
void onEvent (const EventCallback callback)
 
void onEvent (const PartialEventCallback callback)
 
bool poll ()
 
bool available (const bool activeTest=false)
 
bool send (const std::string &&data)
 
bool send (const std::string &data)
 
bool send (const char *data)
 
bool send (const char *data, const size_t len)
 
bool sendBinary (const std::string data)
 
bool sendBinary (const char *data, const size_t len)
 
bool stream (const std::string data="")
 
bool streamBinary (const std::string data="")
 
bool end (const std::string data="")
 
void setFragmentsPolicy (const FragmentsPolicy newPolicy)
 
FragmentsPolicy getFragmentsPolicy () const
 
WebsocketsMessage readBlocking ()
 
bool ping (const std::string data="")
 
bool pong (const std::string data="")
 
void close (const CloseReason reason=CloseReason_NormalClosure)
 
CloseReason getCloseReason () const
 
void setUseMasking (bool useMasking)
 
virtual ~WebsocketsClient ()
 
std::shared_ptr< network::TcpClientclient ()
 

Detailed Description

Definition at line 25 of file client.h.

Constructor & Destructor Documentation

◆ WebsocketsClient() [1/4]

websockets::WebsocketsClient::WebsocketsClient ( )

Definition at line 11 of file client.cpp.

◆ WebsocketsClient() [2/4]

FLASHMEM websockets::WebsocketsClient::WebsocketsClient ( std::shared_ptr< network::TcpClient > client)

Definition at line 16 of file client.cpp.

◆ WebsocketsClient() [3/4]

FLASHMEM websockets::WebsocketsClient::WebsocketsClient ( const WebsocketsClient & other)

Definition at line 24 of file client.cpp.

◆ WebsocketsClient() [4/4]

FLASHMEM websockets::WebsocketsClient::WebsocketsClient ( const WebsocketsClient && other)

Definition at line 35 of file client.cpp.

◆ ~WebsocketsClient()

websockets::WebsocketsClient::~WebsocketsClient ( )
virtual

Definition at line 307 of file client.cpp.

References available(), close(), and websockets::CloseReason_GoingAway.

Member Function Documentation

◆ addHeader()

FLASHMEM void websockets::WebsocketsClient::addHeader ( const std::string key,
const std::string value )

Definition at line 112 of file client.cpp.

References websockets::internals::fromInterfaceString().

◆ available()

◆ client()

std::shared_ptr< network::TcpClient > websockets::WebsocketsClient::client ( )
inline

Definition at line 79 of file client.h.

Referenced by onWebsocketMessageCallback().

◆ close()

void websockets::WebsocketsClient::close ( const CloseReason reason = CloseReason_NormalClosure)

Definition at line 285 of file client.cpp.

References available(), and websockets::internals::WebsocketsEndpoint::close().

Referenced by ~WebsocketsClient().

◆ end()

bool websockets::WebsocketsClient::end ( const std::string data = "")

◆ getCloseReason()

CloseReason websockets::WebsocketsClient::getCloseReason ( ) const

◆ getFragmentsPolicy()

FragmentsPolicy websockets::WebsocketsClient::getFragmentsPolicy ( ) const

◆ onEvent() [1/2]

FLASHMEM void websockets::WebsocketsClient::onEvent ( const EventCallback callback)

Definition at line 125 of file client.cpp.

◆ onEvent() [2/2]

FLASHMEM void websockets::WebsocketsClient::onEvent ( const PartialEventCallback callback)

Definition at line 128 of file client.cpp.

◆ onMessage() [1/2]

FLASHMEM void websockets::WebsocketsClient::onMessage ( const MessageCallback callback)

Definition at line 117 of file client.cpp.

◆ onMessage() [2/2]

FLASHMEM void websockets::WebsocketsClient::onMessage ( const PartialMessageCallback callback)

Definition at line 120 of file client.cpp.

◆ operator=() [1/2]

FLASHMEM WebsocketsClient & websockets::WebsocketsClient::operator= ( const WebsocketsClient && other)

Definition at line 64 of file client.cpp.

◆ operator=() [2/2]

FLASHMEM WebsocketsClient & websockets::WebsocketsClient::operator= ( const WebsocketsClient & other)

Definition at line 46 of file client.cpp.

◆ ping()

bool websockets::WebsocketsClient::ping ( const std::string data = "")

◆ poll()

FLASHMEM bool websockets::WebsocketsClient::poll ( )

◆ pong()

bool websockets::WebsocketsClient::pong ( const std::string data = "")

◆ readBlocking()

WebsocketsMessage websockets::WebsocketsClient::readBlocking ( )

◆ send() [1/4]

bool websockets::WebsocketsClient::send ( const char * data)

Definition at line 185 of file client.cpp.

References send().

◆ send() [2/4]

FLASHMEM bool websockets::WebsocketsClient::send ( const char * data,
const size_t len )

◆ send() [3/4]

bool websockets::WebsocketsClient::send ( const std::string && data)

Definition at line 180 of file client.cpp.

References websockets::internals::fromInterfaceString(), and send().

Referenced by onWebsocketMessageCallback(), send(), send(), and send().

◆ send() [4/4]

bool websockets::WebsocketsClient::send ( const std::string & data)

Definition at line 175 of file client.cpp.

References websockets::internals::fromInterfaceString(), and send().

◆ sendBinary() [1/2]

FLASHMEM bool websockets::WebsocketsClient::sendBinary ( const char * data,
const size_t len )

◆ sendBinary() [2/2]

bool websockets::WebsocketsClient::sendBinary ( const std::string data)

Definition at line 204 of file client.cpp.

References websockets::internals::fromInterfaceString(), and sendBinary().

Referenced by sendBinary().

◆ setFragmentsPolicy()

void websockets::WebsocketsClient::setFragmentsPolicy ( const FragmentsPolicy newPolicy)

◆ setUseMasking()

void websockets::WebsocketsClient::setUseMasking ( bool useMasking)
inline

◆ stream()

bool websockets::WebsocketsClient::stream ( const std::string data = "")

◆ streamBinary()

bool websockets::WebsocketsClient::streamBinary ( const std::string data = "")

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