Exemplo n.º 1
0
        void RefrshCache()
        {
            AddListStatus("Remoting->开始加载缓存......");
            button_ClearCache.Enabled = false;

            DB_CaChe.Get_Base_CommandManage(true, serverSocket.LocalEndPoint.ToString());
            DB_CaChe.Get_Base_OriginalConfigManage(true, serverSocket.LocalEndPoint.ToString());
            DB_CaChe.Get_Base_UserConfigManage(true, serverSocket.LocalEndPoint.ToString());
            DB_CaChe.Get_Base_ProtocolType(true, serverSocket.LocalEndPoint.ToString());
            DB_CaChe.Get_Base_PinYin(true, serverSocket.LocalEndPoint.ToString());
            DB_CaChe.Get_Base_CityInfoManage(true, serverSocket.LocalEndPoint.ToString());

            button_ClearCache.Enabled = true;
            AddListStatus("Remoting->加载缓存完成......");
            listBox_Status.Items.Add("");
        }
Exemplo n.º 2
0
        private void button_Stop_Click(object sender, EventArgs e)
        {
            hours   = 0;
            minute  = 0;
            seconds = 0;

            Mem.Abort();
            Mem = null;

            Time.Abort();
            Time = null;

            label_Mem.Text     = "已停止";
            label_RunTime.Text = "已停止";

            button_Stop.Enabled       = false;
            button_Run.Enabled        = true;
            button_ClearCache.Enabled = false;

            listBox_Online.Items.Clear();
            listBox_Status.Items.Clear();

            Remotingserver.StopListening(null);

            if (Remotingserver.ChannelData == null)
            {
                AddListStatus("Remoting->通道已关闭!");
            }
            else
            {
                AddListStatus("Remoting->通道关闭失败!");
            }


            serverSocket.CloseServer();
            serverSocket = null;
            AddListStatus("Socket->通道已关闭!");


            DB_CaChe.Dispose();
        }