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.CompareIPAddress(instance.EndPoint.Address, Global.MyIPAddress) == 0 &&
                            FileUtility.CompletePath(instance.AssemblyPath, false).ToLowerInvariant().Equals(Global.MyAssemblyPath.ToLowerInvariant()))
                        {
                            return(instance);
                        }
                    }
                }

                foreach (var instance in Proxies[i].Instances)
                {
                    if (IPAddressComparer.CompareIPAddress(instance.EndPoint.Address, Global.MyIPAddress) == 0)
                    {
                        return(instance);
                    }
                }
            }
            return(null);
        }