예제 #1
0
 public void uninit()
 {
     if (global_static_var.is_init_ok)
     {
         Console.WriteLine("IPC发信:通知后台运行的SERVER退出。");
         call.is_IPC_ready_flag = false;
         if (!this.Is_server_IDLE())
         {
             this.CallIPCSend(IPC_NOTIFY_CMD.RQ_CANCEL_PREV_CMD);
             this.CallIPCSend(IPC_NOTIFY_CMD.RQ_CLEAR_CMD_QUEUE);
         }
         this.CallIPCSend(IPC_NOTIFY_CMD.RQ_EXIT);
         call.m_devList = null;
         call.myipc.uninit_ipc_channel();
         call.myipc = null;
         global_static_var.is_init_ok = false;
         GC.Collect();
     }
 }
예제 #2
0
        public Dictionary <string, DEVICE_INFO> init(Form thisPtr)
        {
            Dictionary <string, DEVICE_INFO> result;

            if (global_static_var.is_init_ok)
            {
                MessageBox.Show("编码逻辑错误:通信服务器的调用接口重复初始化。");
                result = null;
            }
            else
            {
                call.m_thisPtr               = thisPtr;
                call.is_IPC_ready_flag       = false;
                call.myipc                   = new IPC_Class();
                call.m_devList               = null;
                call.m_devList               = new Dictionary <string, DEVICE_INFO>();
                global_static_var.is_init_ok = true;
                result = call.m_devList;
            }
            return(result);
        }