Esempio n. 1
0
        public static CPMTcpServer Instance()
        {
            if (_instance == null)
            {
                _instance = new CPMTcpServer();
            }

            return(_instance);
        }
Esempio n. 2
0
        protected override void OnStart(string[] args)
        {
            eventLogCPM.WriteEntry("In OnStart. Listener to be started...");
            //eventLogCPM.WriteEntry("Listener to be started: ");
            //DUETCPMConsole.CPMPAMainForm form = new DUETCPMConsole.CPMPAMainForm();
            //form.Show();

            //System.Diagnostics.Process.Start("C:\\Documents and Settings\\Dilshod\\My Documents\\Visual Studio 2008\\Projects\\DUETCPMConsole\\CPMPayAgentService\\bin\\Debug\\CPMPayAgentService.exe");
            server = CPMTcpServer.Instance();
            server.StartListener();
            eventLogCPM.WriteEntry("Listener started: " + CPMTcpServer.Instance().GetStatus());
            CPMTcpServer.Instance().ErrorOccurred += new EventHandler <CPMErrorEventArgs>(OnErrorOccurred);

            //eventLogCPM.WriteEntry(CPMTcpServer.Instance().GetStatus());//"Main Console is shown");
            //TestForm form = new TestForm();
            //form.Show();
            //Application.Run(form);
            //eventLogCPM.WriteEntry(CPMTcpServer.Instance().GetStatus());
        }
Esempio n. 3
0
 protected override void OnStop()
 {
     server.StopListener();
     CPMTcpServer.Instance().ErrorOccurred -= new EventHandler <CPMErrorEventArgs>(OnErrorOccurred);
     eventLogCPM.WriteEntry("In OnStop - stopping listener.");
 }