Realm C++ SDK Version v2.2.0
Public Member Functions | List of all members

realm::networking::default_socket Struct Reference

Built in websocket client. More...

Inheritance diagram for realm::networking::default_socket:
realm::networking::websocket_interface

Public Member Functions

 default_socket (std::unique_ptr<::realm::sync::WebSocketInterface > &&)
 
void async_write_binary (std::string_view data, websocket_interface::FunctionHandler &&handler) override
 
- Public Member Functions inherited from realm::networking::websocket_interface
virtual ~websocket_interface ()=default
 
virtual void async_write_binary (std::string_view data, FunctionHandler &&handler)=0
 

Additional Inherited Members

- Public Types inherited from realm::networking::websocket_interface
using FunctionHandler = std::function< void(status)>
 

Detailed Description

Built in websocket client.

Member Function Documentation

◆ async_write_binary()

void realm::networking::default_socket::async_write_binary ( std::string_view  data,
websocket_interface::FunctionHandler &&  handler 
)
overridevirtual

Write data asynchronously to the WebSocket connection. The handler function will be called when the data has been sent successfully. The web_socket_oberver provided when the WebSocket was created will be called if any errors occur during the write operation.

Parameters
dataA std::string_view containing the data to be sent to the server.
handlerThe handler function to be called when the data has been sent successfully or the websocket has been closed (with ErrorCodes::OperationAborted). If an error occurs during the write operation, the websocket will be closed and the error will be provided via the websocket_closed_handler() function.

Implements realm::networking::websocket_interface.


The documentation for this struct was generated from the following file: