Example #1
0
        /// <summary>
        /// Gets PMServices to send the log.
        /// </summary>
        public PMServices getPMServices()
        {
            //Getting the PMServices object
            PMServices obj = (PMServices)Activator.GetObject(typeof(PMServices), repInfo.PmsUrl);

            return(obj);
        }
Example #2
0
        /// <summary>
        /// Notifies PM with a message.
        /// </summary>
        /// <param name="msg">Message sent to PM.</param>
        public void NotifyPM(string msg)
        {
            if (repInfo.LoggingLvl.Equals("full"))
            {
                PMServices service = getPMServices();

                AsyncDelegate RemoteDel = new AsyncDelegate(service.SendToLog);

                // Call delegate to remote method
                IAsyncResult RemAr = RemoteDel.BeginInvoke(msg, null, null);
            }
        }
Example #3
0
        public void startPM()
        {
            Console.WriteLine($"Starting Puppet Master in port 10000...............");
            Grpc.Core.Server pm_server = new Grpc.Core.Server
            {
                Services = { PMServices.BindService(this) },
                Ports    = { new ServerPort("localhost", 10000, ServerCredentials.Insecure) }
            };

            pm_server.Start();
            Console.WriteLine($"Puppet Master is now listening...............");
            //Thread.Sleep(10000000);
            Console.ReadKey();
            Console.WriteLine($"Puppet Master is closing...............");
            pm_server.ShutdownAsync().Wait();
        }