MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / connect_remote

Method connect_remote

source/MaaAdbControlUnit/General/Connection.cpp:99–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool Connection::connect_remote()
100{
101 auto argv_opt = connect_argv_.gen(argv_replace_);
102 if (!argv_opt) {
103 return false;
104 }
105
106 using namespace std::chrono_literals;
107 auto output_opt = startup_and_read_pipe(*argv_opt, 60s);
108 if (!output_opt) {
109 return false;
110 }
111
112 constexpr std::array<std::string_view, 4> kErrorFlag = { "error", "cannot", "refused", "unable to connect" };
113 for (const auto& flag : kErrorFlag) {
114 if (output_opt->find(flag) != std::string::npos) {
115 LogInfo << "unable to connect";
116 return false;
117 }
118 }
119
120 LogInfo << "connected";
121 return true;
122}
123
124bool Connection::start_monitor()
125{

Callers

nothing calls this directly

Calls 2

genMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected