internal static ExchangeNetwork GetNetwork(string netName)
		{
			ExchangeNetworkMap map = NetworkManager.GetMap();
			if (map != null)
			{
				return map.GetNetwork(netName);
			}
			return null;
		}
		internal static ExchangeNetwork LookupEndPoint(IPAddress ipAddr, out NetworkEndPoint endPoint)
		{
			endPoint = null;
			ExchangeNetworkMap map = NetworkManager.GetMap();
			if (map != null)
			{
				return map.LookupEndPoint(ipAddr, out endPoint);
			}
			return null;
		}
		internal static TcpClientChannel OpenConnection(ref NetworkPath actualPath, int timeoutInMsec, bool ignoreNodeDown)
		{
			NetworkPath networkPath = actualPath;
			NetworkTransportException ex = null;
			ITcpConnector tcpConnector = Dependencies.TcpConnector;
			TcpClientChannel tcpClientChannel = tcpConnector.TryConnect(networkPath, timeoutInMsec, out ex);
			if (tcpClientChannel != null)
			{
				return tcpClientChannel;
			}
			if (!networkPath.NetworkChoiceIsMandatory)
			{
				NetworkManager.TraceError("Attempting alternate routes", new object[0]);
				List<NetworkPath> list = null;
				ExchangeNetworkMap map = NetworkManager.GetMap();
				if (map != null)
				{
					list = map.EnumeratePaths(networkPath.TargetNodeName, ignoreNodeDown);
					if (list != null)
					{
						NetworkPath networkPath2 = null;
						foreach (NetworkPath networkPath3 in list)
						{
							if (string.Equals(networkPath3.NetworkName, networkPath.NetworkName, DatabaseAvailabilityGroupNetwork.NameComparison))
							{
								networkPath2 = networkPath3;
								break;
							}
						}
						if (networkPath2 != null)
						{
							list.Remove(networkPath2);
						}
						DagNetConfig dagConfig = DagNetEnvironment.FetchNetConfig();
						foreach (NetworkPath networkPath4 in list)
						{
							networkPath4.Purpose = networkPath.Purpose;
							networkPath4.ApplyNetworkPolicy(dagConfig);
							tcpClientChannel = tcpConnector.TryConnect(networkPath, timeoutInMsec, out ex);
							if (tcpClientChannel != null)
							{
								actualPath = networkPath4;
								return tcpClientChannel;
							}
						}
					}
				}
			}
			throw ex;
		}
		private static ExchangeNetworkMap FetchInitializedMap()
		{
			ExchangeNetworkMap map = NetworkManager.GetMap();
			if (map == null)
			{
				NetworkManager.TraceError("NetworkMap has not yet been initialized. Sleeping for {0}ms", new object[]
				{
					NetworkManager.GetInitializationTimeoutInMsec()
				});
				Thread.Sleep(NetworkManager.GetInitializationTimeoutInMsec());
				map = NetworkManager.GetMap();
				if (map == null)
				{
					throw new DagNetworkManagementException(ReplayStrings.NetworkManagerInitError);
				}
			}
			return map;
		}