renamed "add" to "sendAsync"

This commit is contained in:
badaix 2015-09-12 19:45:03 +02:00
parent 8b98a79806
commit 02ec52e765
4 changed files with 7 additions and 7 deletions

View file

@ -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);
} }

View file

@ -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);
} }

View file

@ -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
{ {

View file

@ -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());
} }
} }