MCPcopy Create free account
hub / github.com/Snapchat/Valdi / onClientDisconnected

Method onClientDisconnected

valdi/src/valdi/jscore/JSCoreDebuggerProxy.cpp:239–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void DebuggerProxy::onClientDisconnected(const Valdi::Ref<Valdi::ITCPConnection>& client, const Valdi::Error& error) {
240 if (_jsHost->ownsClient(client)) {
241 VALDI_INFO(Valdi::ConsoleLogger::getLogger(),
242 "[JSDebugger] JSCore client disconnected from {}: {}",
243 client->getAddress(),
244 error);
245 } else {
246 VALDI_INFO(Valdi::ConsoleLogger::getLogger(),
247 "[JSDebugger] External client disconnected from {}: {}",
248 client->getAddress(),
249 error);
250
251 auto connection = std::dynamic_pointer_cast<ExternalDebuggerConnection>(client->getDataListener());
252 connection->submitMessageToJs(STRING_LITERAL("FrontendDidClose"), STRING_LITERAL("{}"));
253 }
254}
255
256uint16_t DebuggerProxy::getInternalPort() const {
257 return static_cast<uint16_t>(kJsDebuggerPort);

Callers

nothing calls this directly

Calls 3

submitMessageToJsMethod · 0.80
ownsClientMethod · 0.45
getDataListenerMethod · 0.45

Tested by

no test coverage detected