MCPcopy Create free account
hub / github.com/RGAA-Software/GoDesk / StartSpvrClientIfNeeded

Method StartSpvrClientIfNeeded

src/render_panel/gr_application.cpp:504–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502 }
503
504 void GrApplication::StartSpvrClientIfNeeded() {
505 auto appkey = GetAppkey();
506 auto spvr_host = settings_->GetSpvrServerHost();
507 auto spvr_port = settings_->GetSpvrServerPort();
508 auto device_id = settings_->GetDeviceId();
509 if (appkey.empty() || spvr_host.empty() || spvr_port <= 0 || device_id.empty()) {
510 return;
511 }
512
513 if (appkey != using_appkey_) {
514 LOGW("Appkey changed, {} => {} will release WS:SpvrClient and recreate it.", using_appkey_, appkey);
515 if (spvr_client_) {
516 spvr_client_->Stop();
517 spvr_client_ = nullptr;
518 }
519 }
520
521 if (!spvr_client_) {
522 spvr_client_ = std::make_shared<GrSpvrClient>(context_, spvr_host, spvr_port, device_id);
523 }
524 if (!spvr_client_->IsStarted()) {
525 spvr_client_->Start();
526 }
527 using_appkey_ = appkey;
528 }
529
530 std::shared_ptr<SpvrScanner> GrApplication::GetSpvrScanner() {
531 return spvr_scanner_;

Callers 1

Calls 6

GetSpvrServerHostMethod · 0.80
GetSpvrServerPortMethod · 0.80
IsStartedMethod · 0.80
GetDeviceIdMethod · 0.45
StopMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected