Exemplo n.º 1
0
        // 从ini文件或者registry装载已经配置的所有主机事项
        public int InitialHostArray(ApplicationInfo appInfoParam)
        {
            int       i, nMax;
            HostEntry entry = null;

            this.Clear();

            appinfo = appInfoParam;     // 保存下来备用

            if (appInfoParam == null)   // 2006/11/21
            {
                return(0);
            }

            ArrayList saHost = LoadHosts(appInfoParam);

            nMax = saHost.Count;
            for (i = 0; i < nMax; i++)
            {
                entry = new HostEntry();
                entry.m_strHostName = (string)saHost[i];
                this.Add(entry);
                entry.Container = this;
            }

            return(0);
        }
Exemplo n.º 2
0
        public void CloseAllSockets()
        {
            for (int i = 0; i < this.Count; i++)
            {
                HostEntry entry = (HostEntry)this[i];
                Debug.Assert(entry != null, "HostEntry中出现空元素");

                if (entry.client != null)
                {
                    entry.client.Close();
                    entry.client = null;
                }
            }
        }
Exemplo n.º 3
0
        // 以主机名字或者别名寻找主机事项
        public HostEntry MatchHostEntry(string strHostName)
        {
            for (int i = 0; i < this.Count; i++)
            {
                HostEntry entry = (HostEntry)this[i];
                Debug.Assert(entry != null, "HostEntry中出现空元素");

                if ((String.Compare(strHostName, entry.m_strHostName, true) == 0) ||
                    (String.Compare(strHostName, entry.m_strAlias, true) == 0))
                {
                    return(entry);
                }
            }
            return(null);
        }
Exemplo n.º 4
0
		// 从ini文件或者registry装载已经配置的所有主机事项
		public int InitialHostArray(ApplicationInfo appInfoParam)
		{
			int i, nMax;
			HostEntry entry = null;

			this.Clear();

			appinfo = appInfoParam;	// 保存下来备用

            if (appInfoParam == null)   // 2006/11/21
                return 0;

			ArrayList saHost = LoadHosts(appInfoParam);
			nMax = saHost.Count;
			for(i=0; i<nMax; i++) 
			{
				entry = new HostEntry();
				entry.m_strHostName = (string)saHost[i];
				this.Add(entry);
				entry.Container = this;
			}

			return 0;
		}
Exemplo n.º 5
0
		// 摧毁一个Host事项
		public int DestroyHostEntry(HostEntry entry)
		{
			this.Remove(entry);
			return 0; // not found
		}
Exemplo n.º 6
0
 // 摧毁一个Host事项
 public int DestroyHostEntry(HostEntry entry)
 {
     this.Remove(entry);
     return(0);            // not found
 }