Example #1
0
        /// <summary>
        /// Gets the ServerInfo object of current server and it represents the specific information on the current proxy.
        /// </summary>
        /// <returns></returns>
        internal ServerInfo GetMyProxyInfo()
        {
            for (int i = 0; i < Proxies.Count; i++)
            {
                foreach (var instance in Proxies[i].Instances)
                {
                    if (instance.AssemblyPath != null)
                    {
                        if (IPAddressComparer.IsLocalhost(instance.HostName) &&
                            FileUtility.ComparePath(instance.AssemblyPath, Global.MyAssemblyPath))
                        {
                            return(instance);
                        }
                    }
                }

                foreach (var instance in Proxies[i].Instances)
                {
                    if (IPAddressComparer.IsLocalhost(instance.HostName))
                    {
                        return(instance);
                    }
                }
            }
            return(null);
        }