|
Giri's C++ Support Library
C++ library providing everything you need to quickly create awesome applications.
|
Simple Websocket Client. More...
#include <WebSocketClient.h>


Public Types | |
| using | SPtr = std::shared_ptr< WebSocketClient > |
| using | UPtr = std::unique_ptr< WebSocketClient > |
Public Types inherited from giri::Object< T > | |
| using | SPtr = std::shared_ptr< T > |
| using | UPtr = std::unique_ptr< T > |
| using | WPtr = std::weak_ptr< T > |
Public Member Functions | |
| WebSocketClient (const std::string &host, const std::string &port, bool ssl=false, const size_t numThreads=1, const std::string &resource="/") | |
| void | send (const std::string &msg) |
| msg Message to send More... | |
| std::string | getMessage () |
| std::string | getHost () |
| std::string | getPort () |
| bool | getSSL () |
| boost::system::error_code | getError () |
| void | run () |
| std::string | receive () |
| void | close () |
Public Member Functions inherited from giri::Observable< WebSocketClient > | |
| void | subscribe (const std::weak_ptr< Observer< WebSocketClient > > &obs) |
| void | unsubscribe (const std::weak_ptr< Observer< WebSocketClient > > &obs) |
| void | unsubscribeAll () |
| void | notify () |
Simple Websocket Client.
Supporting synchronous and asynchronous read.
|
inline |
Constructor to create a websocket client.
| host | Websocket server host. |
| port | Websocket server port. |
| ssl | Enables or disables ssl (defaults to false). |
| numThreads | Number of threads to be used (defaults to 1). |
| resource | Resource where websocket server is bound to (defaults to "/"). |
|
inline |
Close websocket client.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Receives message synchronously. Blocks until a message was received.
|
inline |
Starts receiving messages asynchrolously. Automatically notifies subscribed Observer objects on new messages.
|
inline |
msg Message to send
Send a message to server. Blocks until message was sent.