| 188 | } |
| 189 | |
| 190 | void WSConnection::SendMsg(const std::string &msg) |
| 191 | { |
| 192 | const auto status = _client.GetStatus(); |
| 193 | if (status == WSClientConnection::Status::DISCONNECTED) { |
| 194 | _client.Connect(GetURI(), _password, _reconnect, |
| 195 | _reconnectDelay); |
| 196 | blog(LOG_WARNING, |
| 197 | "could not send message '%s' (connection to '%s' not established)", |
| 198 | msg.c_str(), GetURI().c_str()); |
| 199 | return; |
| 200 | } |
| 201 | |
| 202 | if (status == WSClientConnection::Status::AUTHENTICATED) { |
| 203 | _client.SendRequest(msg); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | void WSConnection::Load(obs_data_t *obj) |
| 208 | { |
no test coverage detected