Ejemplo n.º 1
0
        /// <summary>Asynchronously resolves an IP address to an <see cref="T:System.Net.IPHostEntry" /> instance.</summary>
        /// <returns>An <see cref="T:System.IAsyncResult" /> instance that references the asynchronous request.</returns>
        /// <param name="address">The IP address to resolve.</param>
        /// <param name="requestCallback">An <see cref="T:System.AsyncCallback" /> delegate that references the method to invoke when the operation is complete. </param>
        /// <param name="stateObject">A user-defined object that contains information about the operation. This object is passed to the <paramref name="requestCallback" /> delegate when the operation is complete.</param>
        /// <exception cref="T:System.ArgumentNullException">
        ///   <paramref name="address" /> is null. </exception>
        /// <exception cref="T:System.Net.Sockets.SocketException">An error is encountered when resolving <paramref name="address" />. </exception>
        /// <exception cref="T:System.ArgumentException">
        ///   <paramref name="address" /> is an invalid IP address.</exception>
        public static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback requestCallback, object stateObject)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }
            GetHostEntryIPCallback getHostEntryIPCallback = GetHostEntry;

            return(getHostEntryIPCallback.BeginInvoke(address, requestCallback, stateObject));
        }
Ejemplo n.º 2
0
        public static IAsyncResult BeginGetHostEntry(IPAddress hostAddress,
                                                     AsyncCallback requestCallback, object stateObject)
        {
            if (hostAddress == null)
            {
                throw new ArgumentNullException("hostAddress");
            }

            GetHostEntryIPCallback c = new GetHostEntryIPCallback(GetHostEntry);

            return(c.BeginInvoke(hostAddress, requestCallback, stateObject));
        }
Ejemplo n.º 3
0
        public static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback requestCallback, object stateObject)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            if (use_mono_dns)
            {
                return(BeginAsyncCall(address.ToString(), requestCallback, stateObject));
            }

            GetHostEntryIPCallback c = new GetHostEntryIPCallback(GetHostEntry);

            return(c.BeginInvoke(address, requestCallback, stateObject));
        }
Ejemplo n.º 4
0
        public static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback requestCallback, object stateObject)
        {
#if FEATURE_NO_BSD_SOCKETS
            throw new PlatformNotSupportedException("System.Net.Dns:BeginGetHostEntry is not supported on this platform.");
#else
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

#if !MOBILE
            if (use_mono_dns)
            {
                return(BeginAsyncCall(address.ToString(), requestCallback, stateObject));
            }
#endif

            GetHostEntryIPCallback c = new GetHostEntryIPCallback(GetHostEntry);
            return(c.BeginInvoke(address, requestCallback, stateObject));
#endif // FEATURE_NO_BSD_SOCKETS
        }
Ejemplo n.º 5
0
Archivo: Dns.cs Proyecto: westybsa/mono
		public static IAsyncResult BeginGetHostEntry (IPAddress address, AsyncCallback requestCallback, object stateObject)
		{
			if (address == null)
				throw new ArgumentNullException ("address");

			if (use_mono_dns)
				return BeginAsyncCall (address.ToString (), requestCallback, stateObject);

			GetHostEntryIPCallback c = new GetHostEntryIPCallback (GetHostEntry);
			return c.BeginInvoke (address, requestCallback, stateObject);
		}
Ejemplo n.º 6
0
		public static IAsyncResult BeginGetHostEntry (IPAddress address, AsyncCallback requestCallback, object stateObject)
		{
#if FEATURE_NO_BSD_SOCKETS
			throw new PlatformNotSupportedException ("System.Net.Dns:BeginGetHostEntry is not supported on this platform.");
#else
			if (address == null)
				throw new ArgumentNullException ("address");

#if !MOBILE
			if (use_mono_dns)
				return BeginAsyncCall (address.ToString (), requestCallback, stateObject);
#endif

			GetHostEntryIPCallback c = new GetHostEntryIPCallback (GetHostEntry);
			return c.BeginInvoke (address, requestCallback, stateObject);
#endif // FEATURE_NO_BSD_SOCKETS
		}