mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-15 18:16:44 +02:00
renamed "add" to "sendAsync"
This commit is contained in:
parent
8b98a79806
commit
02ec52e765
4 changed files with 7 additions and 7 deletions
|
@ -64,7 +64,7 @@ void ControlServer::send(const std::string& message)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto s : sessions_)
|
for (auto s : sessions_)
|
||||||
s->add(message);
|
s->sendAsync(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ void ControlSession::stop()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ControlSession::add(const std::string& message)
|
void ControlSession::sendAsync(const std::string& message)
|
||||||
{
|
{
|
||||||
messages_.push(message);
|
messages_.push(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
bool send(const std::string& message) const;
|
bool send(const std::string& message) const;
|
||||||
|
|
||||||
/// Sends a message to the client (asynchronous)
|
/// Sends a message to the client (asynchronous)
|
||||||
void add(const std::string& message);
|
void sendAsync(const std::string& message);
|
||||||
|
|
||||||
bool active() const
|
bool active() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,7 +93,7 @@ void StreamServer::onDisconnect(ClientSession* connection)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void StreamServer::onMessageReceived(ControlSession* connection, const std::string& message)
|
void StreamServer::onMessageReceived(ControlSession* controlSession, const std::string& message)
|
||||||
{
|
{
|
||||||
JsonRequest request;
|
JsonRequest request;
|
||||||
try
|
try
|
||||||
|
@ -171,16 +171,16 @@ void StreamServer::onMessageReceived(ControlSession* connection, const std::stri
|
||||||
controlServer_->send(notification.dump());
|
controlServer_->send(notification.dump());
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->send(request.getResponse(response).dump());
|
controlSession->send(request.getResponse(response).dump());
|
||||||
}
|
}
|
||||||
catch (const JsonRequestException& e)
|
catch (const JsonRequestException& e)
|
||||||
{
|
{
|
||||||
connection->send(e.getResponse().dump());
|
controlSession->send(e.getResponse().dump());
|
||||||
}
|
}
|
||||||
catch (const exception& e)
|
catch (const exception& e)
|
||||||
{
|
{
|
||||||
JsonInternalErrorException jsonException(e.what(), request.id);
|
JsonInternalErrorException jsonException(e.what(), request.id);
|
||||||
connection->send(jsonException.getResponse().dump());
|
controlSession->send(jsonException.getResponse().dump());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue