/// <summary> /// ���һ�����ƶ� /// </summary> /// <param name="serverAddress">����˵�ַ</param> /// <param name="insertIntoTreeNode">�Ƿ���ӵ������б���</param> /// <returns>���οؼ��Ľ���� �� �Ѿ����ӵķ������ �Ƿ�ƥ��</returns> private bool InsertControler(System.Net.IPAddress serverAddress,bool insertIntoTreeNode) { DisplayMessage("��������" + serverAddress + "..."); //������Դ���10 BaseControler mainControler = new BaseControler(serverAddress, Constant.Port_Main, 10); mainControler.Execute = new ExecuteCodeEvent(mainExecuteCode); // mainControler.MaxTimes = Constant.MaxTimes; mainControler.Connecting(); if (mainControler.HaveConnected) { DisplayMessage("����" + serverAddress + "�ɹ�!"); currentControler = mainControler; curServerIP = mainControler.ServerAddress; //�Ƿ���ӵ������б��� if (insertIntoTreeNode) { try { trv_HostView.Invoke(new TreeViewAddEvent(TreeViewAddNode), new object[] { serverAddress }); } catch { return false; } } } else DisplayMessage("����" + serverAddress + "���ɹ�!"); return true; }
/// <summary> /// �رյ�ǰ���ƶ� /// </summary> public void CloseCurrentControler() { if (currentControler != null) currentControler.CloseConnections(); if (mainControlerThread != null && mainControlerThread.IsAlive) mainControlerThread.Abort(); currentControler = null; }