| 257 | int senderClientId, |
| 258 | const BytesView& payload) { |
| 259 | std::lock_guard<Mutex> lock(_mutex); |
| 260 | for (const auto& it : _listeners) { |
| 261 | auto listener = it.lock(); |
| 262 | if (listener != nullptr) { |
| 263 | listener->daemonClientDidReceiveClientPayload(strongRef(daemonClient), senderClientId, payload); |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | Ref<DaemonClient> DebuggerService::addDaemonClient(const Ref<ITCPConnection>& tcpClient) { |
| 269 | if (_runtimeMessageHandler != nullptr) { |
| 270 | _runtimeMessageHandler->onDebugMessage(LogTypeInfo, "Connected to Valdi Hot Reloader!"); |
| 271 | } |
| 272 | |
| 273 | std::lock_guard<Mutex> guard(_mutex); |
| 274 | |
| 275 | auto daemonClient = Valdi::makeShared<DaemonClient>(this, ++_connectionIdSequence, _logger); |
| 276 | tcpClient->setDataListener(Valdi::makeShared<DaemonClientTCPListener>(daemonClient)); |
| 277 | daemonClient->setDataSender(Valdi::makeShared<DaemonClientTCPDataSender>(tcpClient)); |
| 278 | _clients.emplace_back(daemonClient); |
| 279 | |
| 280 | for (const auto& it : _listeners) { |
| 281 | auto listener = it.lock(); |
| 282 | if (listener != nullptr) { |
nothing calls this directly
no test coverage detected