Пример #1
0
        public static void Run()
        {
            // create new server and start it
            Server = new Grpc.Core.Server
            {
                Services = { Publisher.BindService(new Plugin.Plugin()) },
                Ports    = { new ServerPort("localhost", 0, ServerCredentials.Insecure) }
            };
            Server.Start();

            // write out the connection information for the Hashicorp plugin runner
            var output = String.Format("{0}|{1}|{2}|{3}:{4}|{5}",
                                       1, 1, "tcp", "localhost", Server.Ports.First().BoundPort, "grpc");

            Console.WriteLine(output);

            Logger.Info("Started on port " + Server.Ports.First().BoundPort);

            try
            {
                // create the config file for Sisense and restart Sisense
                var sisenseConfig = Replication.GenerateSisenseConfig();
                Replication.AddSisenseService(sisenseConfig);
            }
            catch (Exception e)
            {
                Logger.Error(e.Message);
            }
        }