|
OSSIA
Open Scenario System for Interactive Application
|
Inherits Nano::Observer.
Owns the transport and every websocketpp-side callback.
The Nano::Observer lives here and not on the QObject on purpose: the signals it listens to belong to client, a member of this very object, so the unsynchronized slot lists can only be mutated while the whole state is being destroyed, at which point no handler can still be running. The QObject, destroyed on the Qt thread while the websocketpp thread may be firing, is only ever reached under qt_mutex.
Public Attributes | |
| std::string | url |
| std::unique_ptr< ossia::net::websocket_client > | client |
| std::atomic_bool | alive {true} |
| std::atomic_bool | closed {false} |
| std::mutex | qt_mutex |
| qml_websocket_outbound_socket * | self {} |
| std::atomic_bool ossia::qt::qml_websocket_outbound_socket::state::closed {false} |
The script's onClose is reported at most once, be it a peer-initiated close or an explicit one.
| std::mutex ossia::qt::qml_websocket_outbound_socket::state::qt_mutex |
Guards self, which is cleared before the QObject starts dying. Held for the whole asio -> Qt handover.