コード例 #1
0
        private void CreateManagementChannels()
        {
            // Create our management interface server
            managementInterfaceServer = new ManagementInterfaceService();
            managementInterfaceServer.Initialize(this, null, null, null, null, null, null);

            if (Properties.Settings.Default.EnableRemoteManagement)
            {
                // Create our remoting object for our management server
                tcpManagementDataServer = new TcpRemotingServer("CallButler TCP Management Server (" + Properties.Settings.Default.ProductID + ")", "CallButlerManagementServer", Properties.Settings.Default.ManagementServicePort, (MarshalByRefObject)managementInterfaceServer);
                tcpManagementDataServer.OnAuthentication += new EventHandler<NET.Remoting.Channels.AuthenticationEventArgs>(managementDataServer_OnAuthentication);
                tcpManagementDataServer.OnManagementAllowed += new EventHandler<NET.Remoting.Channels.ManagementAllowedEventArgs>(managementDataServer_OnManagementAllowed);
            }

            pipeManagementDataServer = new PipeRemotingServer("CallButler PIPE Management Server (" + Properties.Settings.Default.ProductID + ")", "CallButlerManagementServer", Properties.Settings.Default.ManagementServicePort, (MarshalByRefObject)managementInterfaceServer);
            pipeManagementDataServer.OnAuthentication += new EventHandler<NET.Remoting.Channels.AuthenticationEventArgs>(managementDataServer_OnAuthentication);
            pipeManagementDataServer.OnManagementAllowed += new EventHandler<NET.Remoting.Channels.ManagementAllowedEventArgs>(managementDataServer_OnManagementAllowed);
            pipeManagementDataServer.StartServer();
        }
コード例 #2
0
        public void StopService()
        {
            /*if (emService != null)
            {
                emService.Stop();
                emService.Dispose();
                emService = null;
            }

            if (extStateService != null)
            {
                extStateService.ClearState();
                extStateService = null;
            }*/

            if(managementInterfaceServer != null)
                managementInterfaceServer = null;

            if (tcpManagementDataServer != null)
            {
                tcpManagementDataServer.StopServer();
                tcpManagementDataServer = null;
            }

            if (pipeManagementDataServer != null)
            {
                pipeManagementDataServer.StopServer();
                pipeManagementDataServer = null;
            }

            if (vmMailerService != null)
            {
                vmMailerService = null;
            }

            if (vmService != null)
            {
                vmService = null;
            }

            DeInitialize();

            PerformanceCounterService.ResetCounters();
        }