The Client Listener struct which contains methods that will be called on specific events from a Client object.
More...
#include <client.h>
|
virtual void | on_connected ()=0 |
| on_connected is called when the WebSocket connection to Millicast is opened
|
|
virtual void | on_disconnected ()=0 |
| on_disconnected is called when the WebSocket connection to Millicast is closed. If this was an unintended disconnect, a reconnect attempt will happen automatically by default. To turn off the automatic reconnect, set {Option::auto_reconnect} to false.
|
|
virtual void | on_connection_error (int status, const std::string &reason)=0 |
| on_connection_error is called when the attempt to connect to Millicast failed.
|
|
virtual void | on_signaling_error (const std::string &message)=0 |
| Called when millicast sends back an error message in response to a websocket command.
|
|
virtual void | on_stats_report (std::unique_ptr< StatsReport >) |
| on_stats_report is called when a new rtc stats report has been collected.
|
|
virtual void | on_viewer_count (int count)=0 |
| Called when a new viewer join the stream or when a viewer quit the stream.
|
|
virtual | ~ClientListener ()=default |
|
The Client Listener struct which contains methods that will be called on specific events from a Client object.
◆ ~ClientListener()
virtual millicast::ClientListener::~ClientListener |
( |
| ) |
|
|
virtualdefault |
◆ on_connected()
virtual void millicast::ClientListener::on_connected |
( |
| ) |
|
|
pure virtual |
on_connected is called when the WebSocket connection to Millicast is opened
◆ on_connection_error()
virtual void millicast::ClientListener::on_connection_error |
( |
int |
status, |
|
|
const std::string & |
reason |
|
) |
| |
|
pure virtual |
on_connection_error is called when the attempt to connect to Millicast failed.
- Parameters
-
status | The HTTP status code. |
reason | The reason the connection attempt failed. |
◆ on_disconnected()
virtual void millicast::ClientListener::on_disconnected |
( |
| ) |
|
|
pure virtual |
on_disconnected is called when the WebSocket connection to Millicast is closed. If this was an unintended disconnect, a reconnect attempt will happen automatically by default. To turn off the automatic reconnect, set {Option::auto_reconnect} to false.
◆ on_signaling_error()
virtual void millicast::ClientListener::on_signaling_error |
( |
const std::string & |
message | ) |
|
|
pure virtual |
Called when millicast sends back an error message in response to a websocket command.
- Parameters
-
message | The error message received from millicast |
◆ on_stats_report()
virtual void millicast::ClientListener::on_stats_report |
( |
std::unique_ptr< StatsReport > |
| ) |
|
|
inlinevirtual |
on_stats_report is called when a new rtc stats report has been collected.
- See also
- enable_stats
◆ on_viewer_count()
virtual void millicast::ClientListener::on_viewer_count |
( |
int |
count | ) |
|
|
pure virtual |
Called when a new viewer join the stream or when a viewer quit the stream.
- Parameters
-
count | The current number of viewers. |
The documentation for this struct was generated from the following file: