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

Method onClientConnected

valdi/src/valdi/jscore/JSCoreDebuggerProxy.cpp:224–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void DebuggerProxy::onClientConnected(const Valdi::Ref<Valdi::ITCPConnection>& client) {
225 if (_jsHost->ownsClient(client)) {
226 VALDI_INFO(
227 Valdi::ConsoleLogger::getLogger(), "[JSDebugger] JSCore client connected from {}", client->getAddress());
228 client->setDataListener(Valdi::makeShared<JSDebuggerConnection>(*_externHost, *client).toShared());
229 } else {
230 VALDI_INFO(
231 Valdi::ConsoleLogger::getLogger(), "[JSDebugger] External client connected from {}", client->getAddress());
232 auto connection = Valdi::makeShared<ExternalDebuggerConnection>(*_jsHost, *client);
233 client->setDataListener(connection.toShared());
234
235 connection->submitMessageToJs(STRING_LITERAL("Setup"), STRING_LITERAL("{}"));
236 }
237}
238
239void DebuggerProxy::onClientDisconnected(const Valdi::Ref<Valdi::ITCPConnection>& client, const Valdi::Error& error) {
240 if (_jsHost->ownsClient(client)) {

Callers

nothing calls this directly

Calls 4

toSharedMethod · 0.80
submitMessageToJsMethod · 0.80
ownsClientMethod · 0.45
setDataListenerMethod · 0.45

Tested by

no test coverage detected