47 friend struct oscquery_client;
48 friend class ossia::oscquery::query_answerer;
53 using connection_handler = std::weak_ptr<void>;
57 ossia::net::network_context_ptr ctx, uint16_t, uint16_t)
61 ossia::net::network_context_ptr ctx,
62 const std::vector<ossia::net::osc_server_configuration>& conf, uint16_t ws_port,
71 bool push_bundle(
const std::vector<const ossia::net::parameter_base*>&)
override;
72 bool push_raw_bundle(
const std::vector<ossia::net::full_parameter_data>&)
override;
73 bool echo_incoming_message(
84 int get_ws_port()
const noexcept {
return m_wsPort; }
86 bool force_ws()
const noexcept {
return m_forceWS.load(std::memory_order_relaxed); }
87 void set_force_ws(
bool forceWS)
noexcept;
89 const std::vector<ossia::net::osc_server_configuration>&
90 get_transports()
const noexcept
95 Nano::Signal<void(
const std::string&)> onClientConnected;
96 Nano::Signal<void(
const std::string&)> onClientDisconnected;
102 void on_osc_message(
const oscpack::ReceivedMessage& m);
103 void process_raw_osc_data(
const char* data, std::size_t sz);
106 oscquery_client* find_client(
const connection_handler& hdl);
108 void add_node(std::string_view path,
const string_map<std::string>& parameters);
109 void remove_node(std::string_view path,
const std::string& node);
110 void rename_node(std::string_view node,
const std::string& new_name);
113 void on_connectionOpen(
const connection_handler& hdl);
114 void on_connectionClosed(
const connection_handler& hdl);
123 template <
typename T>
126 bool write_impl(std::string_view data,
bool critical);
128 void update_zeroconf();
131 ossia::net::server_reply
132 on_text_ws_message(
const connection_handler& hdl,
const std::string&
message);
133 ossia::net::server_reply
134 on_binary_ws_message(
const connection_handler& hdl,
const std::string&
message);
136 ossia::net::network_context_ptr m_context;
138 std::unique_ptr<ossia::net::websocket_server_interface> m_websocketServer;
140 net::zeroconf_server m_zeroconfServerWS;
143 std::vector<ossia::net::osc_server_configuration> m_oscConf;
146 net::listened_parameters m_listening;
150 std::atomic_int m_clientCount{};
155 mutex_t m_clientsMutex;
161 std::atomic_bool m_forceWS{};