OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
ossia::net::socketio_client Class Referencefinal
Inheritance diagram for ossia::net::socketio_client:
ossia::net::websocket_client_interface

Detailed Description

Socket.IO client implementing websocket_client_interface.

Performs the Engine.IO v4 handshake (HTTP polling followed by WebSocket upgrade) and the Socket.IO v5 CONNECT, then presents incoming Socket.IO EVENT/BINARY_EVENT messages through the standard ws_client_message_handler callback interface. Outgoing send_message/send_binary_message calls are wrapped into Socket.IO EVENT/BINARY_EVENT packets.

Public Member Functions

 socketio_client (boost::asio::io_context &ctx)
 
 socketio_client (boost::asio::io_context &ctx, ws_client_message_handler handler)
 
void connect (const std::string &uri) override
 Start an async connection to the given URI.
 
void connect_and_run (const std::string &uri) override
 Connect and block until the connection closes or fails.
 
void stop () override
 
bool connected () const override
 
void send_message (const std::string &request) override
 
void send_message (const rapidjson::StringBuffer &request) override
 
void send_binary_message (std::string_view request) override
 

Additional Inherited Members

- Public Attributes inherited from ossia::net::websocket_client_interface
Nano::Signal< void()> on_open
 
Nano::Signal< void()> on_close
 
Nano::Signal< void()> on_fail
 

Member Function Documentation

◆ connect()

void ossia::net::socketio_client::connect ( const std::string &  uri)
overridevirtual

Start an async connection to the given URI.

Implements ossia::net::websocket_client_interface.

◆ connect_and_run()

void ossia::net::socketio_client::connect_and_run ( const std::string &  uri)
overridevirtual

Connect and block until the connection closes or fails.

Implements ossia::net::websocket_client_interface.

◆ stop()

void ossia::net::socketio_client::stop ( )
overridevirtual

◆ connected()

bool ossia::net::socketio_client::connected ( ) const
overridevirtual

◆ send_message() [1/2]

void ossia::net::socketio_client::send_message ( const std::string &  request)
overridevirtual

◆ send_message() [2/2]

void ossia::net::socketio_client::send_message ( const rapidjson::StringBuffer &  request)
overridevirtual

◆ send_binary_message()

void ossia::net::socketio_client::send_binary_message ( std::string_view  request)
overridevirtual