mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-14 17:46:45 +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_)
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
bool send(const std::string& message) const;
|
||||
|
||||
/// Sends a message to the client (asynchronous)
|
||||
void add(const std::string& message);
|
||||
void sendAsync(const std::string& message);
|
||||
|
||||
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;
|
||||
try
|
||||
|
@ -171,16 +171,16 @@ void StreamServer::onMessageReceived(ControlSession* connection, const std::stri
|
|||
controlServer_->send(notification.dump());
|
||||
}
|
||||
|
||||
connection->send(request.getResponse(response).dump());
|
||||
controlSession->send(request.getResponse(response).dump());
|
||||
}
|
||||
catch (const JsonRequestException& e)
|
||||
{
|
||||
connection->send(e.getResponse().dump());
|
||||
controlSession->send(e.getResponse().dump());
|
||||
}
|
||||
catch (const exception& e)
|
||||
{
|
||||
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