Esempio n. 1
0
 public void Start(INebulaMasterService hOwner)
 {
     m_hOwner = hOwner;
     m_hRepl  = new Process();
     m_hRepl.StartInfo.FileName = InstallDirectory + "\\REPL.exe";
     m_hRepl.StartInfo.RedirectStandardInput  = true;
     m_hRepl.StartInfo.RedirectStandardOutput = true;
     m_hRepl.StartInfo.RedirectStandardError  = true;
     m_hRepl.StartInfo.UseShellExecute        = false;
     m_hRepl.EnableRaisingEvents = true;
     m_hRepl.OutputDataReceived += M_hRepl_OutputDataReceived;
     m_hRepl.Start();
 }
Esempio n. 2
0
        public NebulaMasterServiceCB(string sAddr, int iPort)
        {
            NetTcpBinding hBinding = new NetTcpBinding();

            //hBinding.MaxBufferPoolSize                              = 0;
            //hBinding.MaxBufferSize                                  = 51200;
            hBinding.MaxReceivedMessageSize = 2147483647;
            hBinding.Security.Mode          = SecurityMode.None;
            EndpointAddress hAddr = new EndpointAddress($"net.tcp://{sAddr}:{iPort}/NebulaMasterService");
            DuplexChannelFactory <INebulaMasterService> hFactory = new DuplexChannelFactory <INebulaMasterService>(typeof(NebulaMasterServiceCB), hBinding, hAddr);

            Service = hFactory.CreateChannel(new InstanceContext(this));

            m_hModules = new List <INebulaModule>();

            IEnumerable <INebulaModule> hModules = from hA in Directory.GetFiles(Environment.CurrentDirectory, "*.dll").SafeSelect(hF => Assembly.UnsafeLoadFrom(hF))
                                                   from hT in hA.GetTypes()
                                                   from hI in hT.GetInterfaces()
                                                   where hI == typeof(INebulaModule)
                                                   select Activator.CreateInstance(hT) as INebulaModule;                     //Manco dante porcoddio

            foreach (INebulaModule hModule in hModules)
            {
                try
                {
                    hModule.Start(Service);
                    m_hModules.Add(hModule);
                }
                catch (Exception)
                {
                    //Skip faulted modules
                }
            }

            NebulaModuleInfo[] hModuleInfos = m_hModules.Select(x => x.ModuleInfo).ToArray();
            Service.Register(Environment.MachineName, hModuleInfos);

            foreach (INebulaModule hModule in m_hModules)
            {
                try
                {
                    hModule.RegistrationComplete();
                }
                catch (Exception)
                {
                    //Skip faulted modules
                }
            }
        }
Esempio n. 3
0
 public void Start(INebulaMasterService hOwner)
 {
     m_hOwner = hOwner;
 }