|
@ -75,6 +75,12 @@ void IflytopFrontEndService::sendReport(json reportType, json report) { |
|
|
report["messageId"] = UUID().toString(); |
|
|
report["messageId"] = UUID().toString(); |
|
|
report["messageType"] = "Report"; |
|
|
report["messageType"] = "Report"; |
|
|
report["reportType"] = reportType; |
|
|
report["reportType"] = reportType; |
|
|
|
|
|
string fromClass, fromFn; |
|
|
|
|
|
try { |
|
|
|
|
|
fromClass = report["fromClass"]; |
|
|
|
|
|
fromFn = report["fromFn"]; |
|
|
|
|
|
} catch (const std::exception& e) { |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
auto serverClients = m_server->getClients(); |
|
|
auto serverClients = m_server->getClients(); |
|
|
if (serverClients.size() != 0) { |
|
|
if (serverClients.size() != 0) { |
|
@ -82,7 +88,7 @@ void IflytopFrontEndService::sendReport(json reportType, json report) { |
|
|
} |
|
|
} |
|
|
for (auto& each : serverClients) { |
|
|
for (auto& each : serverClients) { |
|
|
if (each) { |
|
|
if (each) { |
|
|
logger->debug("send msg to clientId:{}", each->getUrl()); |
|
|
|
|
|
|
|
|
logger->debug("send msg to {}.{} clientId:{}", fromClass, fromFn, each->getUrl()); |
|
|
auto result = each->sendText(report.dump()); |
|
|
auto result = each->sendText(report.dump()); |
|
|
if (!result.success) { |
|
|
if (!result.success) { |
|
|
logger->debug("send failed,clientId:{},error:{}", each->getUrl(), result.compressionError); |
|
|
logger->debug("send failed,clientId:{},error:{}", each->getUrl(), result.compressionError); |
|
|