ToString() public method

public ToString ( ) : string
return string
Exemplo n.º 1
0
		/// <exception cref="UnknownHostException"></exception>
		internal static NbtAddress DoNameQuery(Name name, IPAddress svr)
		{
			NbtAddress addr;
			if (name.HexCode == unchecked(0x1d) && svr == null)
			{
				svr = Client.Baddr;
			}
			// bit of a hack but saves a lookup
			name.SrcHashCode = svr != null ? svr.GetHashCode() : 0;
			addr = GetCachedAddress(name);
			if (addr == null)
			{
				if ((addr = (NbtAddress)CheckLookupTable(name)) == null)
				{
					try
					{
						addr = Client.GetByName(name, svr);
					}
					catch (UnknownHostException)
					{
						addr = UnknownAddress;
					}
					finally
					{
						CacheAddress(name, addr);
						UpdateLookupTable(name);
					}
				}
			}
			if (addr == UnknownAddress)
			{
				throw new UnknownHostException(name.ToString());
			}
			return addr;
		}