Class WsppWebSocket

Inheritance Relationships

Base Type

Class Documentation

class WsppWebSocket : public axr::sdk::net::IWebSocket

Implementation of the IWebSocket interface using the WebSocket++ library.

Public Functions

WsppWebSocket(std::shared_ptr<Configuration> config)
~WsppWebSocket()
virtual std::vector<CloseCallback>::const_iterator AddCloseHandler(CloseCallback callback) override

Registers the given callback function to be notified whenever a socket close event occurs.

Parameters

callback – The callback function to notify on close events.

Returns

The iterator referencing the registered callback. Use this to unregister the callback.

virtual void RemoveCloseHandler(std::vector<CloseCallback>::const_iterator iter) override

Unregisters the callback function at the given iterator. The iterator is provided from the AddCloseHandler function.

Parameters

iter – The iterator referencing the callback function to unregister.

virtual std::vector<MessageCallback>::const_iterator AddMessageHandler(MessageCallback callback) override

Registers the given callback function to be notified whenever a socket message event occurs.

Parameters

callback – The callback function to notify on message events.

Returns

The iterator referencing the registered callback. Use this to unregister the callback.

virtual void RemoveMessageHandler(std::vector<MessageCallback>::const_iterator iter) override

Unregisters the callback function at the given iterator. The iterator is provided from the AddMessageHandler function.

Parameters

iter – The iterator referencing the callback function to unregister.

virtual pplx::task<void> Connect(utility::string_t uri) override

Initiates a connection to the remote server at the given uri.

Parameters

uri – The URI of the remote server to connect to.

virtual pplx::task<void> Close() override

Terminates the active socket connection with the remote server.

inline virtual WebSocketStatus GetStatus() override

Returns the current status of the connection with the remote server.

virtual pplx::task<void> Send(std::shared_ptr<IWebSocketMessage> message) override

Sends the given message to the server through this connection.

Parameters

message – The message to send.