MCPcopy Create free account
hub / github.com/Qv2ray/Qv2ray / KernelInstanceHandler

Method KernelInstanceHandler

src/core/handler/KernelInstanceHandler.cpp:12–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10{
11#define isConnected (vCoreInstance->IsKernelRunning() || !activeKernels.empty())
12 KernelInstanceHandler::KernelInstanceHandler(QObject *parent) : QObject(parent)
13 {
14 KernelInstance = this;
15 vCoreInstance = new V2RayKernelInstance(this);
16 connect(vCoreInstance, &V2RayKernelInstance::OnNewStatsDataArrived, this, &KernelInstanceHandler::OnV2RayStatsDataRcvd_p);
17 connect(vCoreInstance, &V2RayKernelInstance::OnProcessOutputReadyRead, this, &KernelInstanceHandler::OnV2RayKernelLog_p);
18 connect(vCoreInstance, &V2RayKernelInstance::OnProcessErrored, this, &KernelInstanceHandler::OnKernelCrashed_p);
19 //
20 auto kernelList = PluginHost->UsablePlugins();
21 for (const auto &internalName : kernelList)
22 {
23 const auto info = PluginHost->GetPlugin(internalName);
24 if (!info->hasComponent(COMPONENT_KERNEL))
25 continue;
26 auto kernel = info->pluginInterface->GetKernel();
27 for (const auto &protocol : kernel->GetKernelProtocols())
28 {
29 if (kernelMap.contains(protocol))
30 {
31 LOG("Found multiple kernel providers for a protocol: " + protocol);
32 continue;
33 }
34 kernelMap.insert(protocol, internalName);
35 }
36 }
37 }
38
39 KernelInstanceHandler::~KernelInstanceHandler()
40 {

Callers

nothing calls this directly

Calls 3

UsablePluginsMethod · 0.80
GetPluginMethod · 0.80
hasComponentMethod · 0.80

Tested by

no test coverage detected