599{
602 grpc::ServerBuilder builder;
603 int selected_port = 0;
604 std::string server_url = "localhost:0";
605
606
607 builder.AddListeningPort(server_url, grpc::InsecureServerCredentials(), &selected_port);
608 builder.RegisterService(&service);
609
610 std::unique_ptr<grpc::Server> server(builder.BuildAndStart());
611 if (server == nullptr) {
613 bool threadState = threadError->load();
614 threadError->store(true);
615 return;
616 }
617
618 g_serverPort = selected_port;
620 if (!updatedReg) {
622 bool threadState = threadError->load();
623 threadError->store(true);
624 }
625
626 {
627 std::lock_guard<std::mutex> lock(g_serverLock);
628 if (g_serverStopping) {
629 server->Shutdown();
630 }
631 g_server = server.get();
632 }
633
634
635 server->Wait();
636
637 std::lock_guard<std::mutex> lock(g_serverLock);
638 g_server = nullptr;
639}
The PanoptesImpl class is a class that implements the PanoptesExtensibility::Service interface from t...
PanoptesContext * serviceContext
bool CreateRegistryEntryWithPort(DWORD dwPort)