13 public static class Dns 15 private class ResolveAsyncResult : ContextAwareResult
17 internal readonly
string hostName;
19 internal bool includeIPv6;
23 internal ResolveAsyncResult(
string hostName,
object myObject,
bool includeIPv6,
object myState,
AsyncCallback myCallBack)
24 : base(myObject, myState, myCallBack)
26 this.hostName = hostName;
27 this.includeIPv6 = includeIPv6;
30 internal ResolveAsyncResult(
IPAddress address,
object myObject,
bool includeIPv6,
object myState,
AsyncCallback myCallBack)
31 : base(myObject, myState, myCallBack)
33 this.includeIPv6 = includeIPv6;
34 this.address = address;
38 private const int HostNameBufferLength = 256;
42 private const int MaxHostName = 255;
44 private static WaitCallback resolveCallback = ResolveCallback;
55 IntPtr intPtr = hostent.h_addr_list;
67 intPtr = hostent.h_aliases;
88 [Obsolete(
"GetHostByName is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
98 return GetUnresolveAnswer(address);
100 return InternalGetHostByName(hostName, includeIPv6:
false);
103 internal static IPHostEntry InternalGetHostByName(
string hostName)
105 return InternalGetHostByName(hostName, includeIPv6:
true);
108 internal static IPHostEntry InternalGetHostByName(
string hostName,
bool includeIPv6)
112 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostByName", hostName);
114 IPHostEntry iPHostEntry =
null;
115 if (hostName.Length > 255 || (hostName.Length == 255 && hostName[254] !=
'.'))
117 throw new ArgumentOutOfRangeException(
"hostName", SR.GetString(
"net_toolong",
"hostName", 255.ToString(
NumberFormatInfo.
CurrentInfo)));
119 if (
Socket.LegacySupportsIPv6 | includeIPv6)
121 iPHostEntry = GetAddrInfo(hostName);
125 IntPtr intPtr = UnsafeNclNativeMethods.OSSOCK.gethostbyname(hostName);
126 if (intPtr == IntPtr.Zero)
129 if (IPAddress.TryParse(hostName, out IPAddress address))
131 iPHostEntry = GetUnresolveAnswer(address);
134 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostByName", iPHostEntry);
140 iPHostEntry = NativeToHostEntry(intPtr);
144 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostByName", iPHostEntry);
157 [Obsolete(
"GetHostByAddress is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
162 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostByAddress", address);
172 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostByAddress", iPHostEntry);
183 [Obsolete(
"GetHostByAddress is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
188 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostByAddress",
"");
195 IPHostEntry iPHostEntry = InternalGetHostByAddress(address, includeIPv6:
false);
198 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostByAddress", iPHostEntry);
207 if (
Socket.LegacySupportsIPv6 | includeIPv6)
209 string name = TryGetNameInfo(address, out errorCode);
212 errorCode = TryGetAddrInfo(name, out
IPHostEntry hostinfo);
219 Logging.Exception(Logging.Sockets,
"DNS",
"InternalGetHostByAddress",
new SocketException(errorCode));
231 int addr = (int)address.m_Address;
233 if (intPtr != IntPtr.Zero)
235 return NativeToHostEntry(intPtr);
241 Logging.Exception(Logging.Sockets,
"DNS",
"InternalGetHostByAddress", ex);
252 Socket.InitializeSockets();
254 if (UnsafeNclNativeMethods.OSSOCK.gethostname(stringBuilder, 256) != 0)
268 [Obsolete(
"Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
273 Logging.Enter(Logging.Sockets,
"DNS",
"Resolve", hostName);
276 if (hostName ==
null)
285 iPHostEntry = InternalGetHostByAddress(address, includeIPv6:
false);
291 Logging.PrintWarning(Logging.Sockets,
"DNS",
"DNS.Resolve", ex.
Message);
293 iPHostEntry = GetUnresolveAnswer(address);
298 iPHostEntry = InternalGetHostByName(hostName, includeIPv6:
false);
302 Logging.Exit(Logging.Sockets,
"DNS",
"Resolve", iPHostEntry);
311 iPHostEntry.
Aliases =
new string[0];
319 internal static bool TryInternalResolve(
string hostName, out IPHostEntry result)
323 Logging.Enter(Logging.Sockets,
"DNS",
"TryInternalResolve", hostName);
325 if (
string.IsNullOrEmpty(hostName) || hostName.Length > 255)
330 if (IPAddress.TryParse(hostName, out IPAddress address))
332 result = GetUnresolveAnswer(address);
335 if (TryGetAddrInfo(hostName, AddressInfoHints.AI_CANONNAME, out IPHostEntry hostinfo) != 0)
341 if (!ComNetOS.IsWin7Sp1orLater)
345 if (CompareHosts(hostName, hostinfo.HostName))
349 if (TryGetAddrInfo(hostName, AddressInfoHints.AI_FQDN, out IPHostEntry hostinfo2) != 0)
353 if (CompareHosts(hostinfo.HostName, hostinfo2.HostName))
357 hostinfo.isTrustedHost =
false;
361 private static bool CompareHosts(
string host1,
string host2)
363 if (TryNormalizeHost(host1, out
string result) && TryNormalizeHost(host2, out
string result2))
370 private static bool TryNormalizeHost(
string host, out
string result)
372 if (Uri.TryCreate(Uri.UriSchemeHttp + Uri.SchemeDelimiter + host,
UriKind.Absolute, out Uri result2))
381 private static void ResolveCallback(
object context)
383 ResolveAsyncResult resolveAsyncResult = (ResolveAsyncResult)context;
387 result = ((resolveAsyncResult.address ==
null) ? InternalGetHostByName(resolveAsyncResult.hostName, resolveAsyncResult.includeIPv6) : InternalGetHostByAddress(resolveAsyncResult.address, resolveAsyncResult.includeIPv6));
395 resolveAsyncResult.InvokeCallback(ex);
398 resolveAsyncResult.InvokeCallback(result);
401 private static IAsyncResult HostResolutionBeginHelper(
string hostName,
bool justReturnParsedIp,
bool flowContext,
bool includeIPv6,
bool throwOnIPAny,
AsyncCallback requestCallback,
object state)
404 if (hostName ==
null)
406 throw new ArgumentNullException(
"hostName");
408 ResolveAsyncResult resolveAsyncResult;
409 if (IPAddress.TryParse(hostName, out IPAddress address))
411 if (throwOnIPAny && (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any)))
413 throw new ArgumentException(SR.GetString(
"net_invalid_ip_addr"),
"hostNameOrAddress");
415 resolveAsyncResult =
new ResolveAsyncResult(address,
null, includeIPv6, state, requestCallback);
416 if (justReturnParsedIp)
418 IPHostEntry unresolveAnswer = GetUnresolveAnswer(address);
419 resolveAsyncResult.StartPostingAsyncOp(lockCapture:
false);
420 resolveAsyncResult.InvokeCallback(unresolveAnswer);
421 resolveAsyncResult.FinishPostingAsyncOp();
422 return resolveAsyncResult;
427 resolveAsyncResult =
new ResolveAsyncResult(hostName,
null, includeIPv6, state, requestCallback);
431 resolveAsyncResult.StartPostingAsyncOp(lockCapture:
false);
434 resolveAsyncResult.FinishPostingAsyncOp();
435 return resolveAsyncResult;
438 private static IAsyncResult HostResolutionBeginHelper(IPAddress address,
bool flowContext,
bool includeIPv6,
AsyncCallback requestCallback,
object state)
443 throw new ArgumentNullException(
"address");
445 if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
447 throw new ArgumentException(SR.GetString(
"net_invalid_ip_addr"),
"address");
449 ResolveAsyncResult resolveAsyncResult =
new ResolveAsyncResult(address,
null, includeIPv6, state, requestCallback);
452 resolveAsyncResult.StartPostingAsyncOp(lockCapture:
false);
455 resolveAsyncResult.FinishPostingAsyncOp();
456 return resolveAsyncResult;
459 private static IPHostEntry HostResolutionEndHelper(IAsyncResult asyncResult)
461 if (asyncResult ==
null)
463 throw new ArgumentNullException(
"asyncResult");
465 ResolveAsyncResult resolveAsyncResult = asyncResult as ResolveAsyncResult;
466 if (resolveAsyncResult ==
null)
468 throw new ArgumentException(SR.GetString(
"net_io_invalidasyncresult"),
"asyncResult");
470 if (resolveAsyncResult.EndCalled)
472 throw new InvalidOperationException(SR.GetString(
"net_io_invalidendcall",
"EndResolve"));
474 resolveAsyncResult.InternalWaitForCompletion();
475 resolveAsyncResult.EndCalled =
true;
476 Exception ex = resolveAsyncResult.Result as Exception;
481 return (IPHostEntry)resolveAsyncResult.Result;
492 [Obsolete(
"BeginGetHostByName is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
493 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
498 Logging.Enter(Logging.Sockets,
"DNS",
"BeginGetHostByName", hostName);
500 IAsyncResult asyncResult = HostResolutionBeginHelper(hostName, justReturnParsedIp:
true, flowContext:
true, includeIPv6:
false, throwOnIPAny:
false, requestCallback, stateObject);
503 Logging.Exit(Logging.Sockets,
"DNS",
"BeginGetHostByName", asyncResult);
513 [Obsolete(
"EndGetHostByName is obsoleted for this type, please use EndGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
518 Logging.Enter(Logging.Sockets,
"DNS",
"EndGetHostByName", asyncResult);
520 IPHostEntry iPHostEntry = HostResolutionEndHelper(asyncResult);
523 Logging.Exit(Logging.Sockets,
"DNS",
"EndGetHostByName", iPHostEntry);
539 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostEntry", hostNameOrAddress);
542 if (hostNameOrAddress ==
null)
551 throw new ArgumentException(SR.GetString(
"net_invalid_ip_addr"),
"hostNameOrAddress");
553 iPHostEntry = InternalGetHostByAddress(address, includeIPv6:
true);
557 iPHostEntry = InternalGetHostByName(hostNameOrAddress, includeIPv6:
true);
561 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostEntry", iPHostEntry);
578 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostEntry",
"");
589 IPHostEntry iPHostEntry = InternalGetHostByAddress(address, includeIPv6:
true);
592 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostEntry", iPHostEntry);
610 Logging.Enter(Logging.Sockets,
"DNS",
"GetHostAddresses", hostNameOrAddress);
613 if (hostNameOrAddress ==
null)
622 throw new ArgumentException(SR.GetString(
"net_invalid_ip_addr"),
"hostNameOrAddress");
631 array = InternalGetHostByName(hostNameOrAddress, includeIPv6:
true).
AddressList;
635 Logging.Exit(Logging.Sockets,
"DNS",
"GetHostAddresses", array);
651 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
656 Logging.Enter(Logging.Sockets,
"DNS",
"BeginGetHostEntry", hostNameOrAddress);
658 IAsyncResult asyncResult = HostResolutionBeginHelper(hostNameOrAddress, justReturnParsedIp:
false, flowContext:
true, includeIPv6:
true, throwOnIPAny:
true, requestCallback, stateObject);
661 Logging.Exit(Logging.Sockets,
"DNS",
"BeginGetHostEntry", asyncResult);
676 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
681 Logging.Enter(Logging.Sockets,
"DNS",
"BeginGetHostEntry", address);
683 IAsyncResult asyncResult = HostResolutionBeginHelper(address, flowContext:
true, includeIPv6:
true, requestCallback, stateObject);
686 Logging.Exit(Logging.Sockets,
"DNS",
"BeginGetHostEntry", asyncResult);
700 Logging.Enter(Logging.Sockets,
"DNS",
"EndGetHostEntry", asyncResult);
702 IPHostEntry iPHostEntry = HostResolutionEndHelper(asyncResult);
705 Logging.Exit(Logging.Sockets,
"DNS",
"EndGetHostEntry", iPHostEntry);
721 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
726 Logging.Enter(Logging.Sockets,
"DNS",
"BeginGetHostAddresses", hostNameOrAddress);
728 IAsyncResult asyncResult = HostResolutionBeginHelper(hostNameOrAddress, justReturnParsedIp:
true, flowContext:
true, includeIPv6:
true, throwOnIPAny:
true, requestCallback, state);
731 Logging.Exit(Logging.Sockets,
"DNS",
"BeginGetHostAddresses", asyncResult);
743 Logging.Enter(Logging.Sockets,
"DNS",
"EndGetHostAddresses", asyncResult);
745 IPHostEntry iPHostEntry = HostResolutionEndHelper(asyncResult);
748 Logging.Exit(Logging.Sockets,
"DNS",
"EndGetHostAddresses", iPHostEntry);
757 Logging.Enter(Logging.Sockets,
"DNS",
"UnsafeBeginGetHostAddresses", hostName);
759 IAsyncResult asyncResult = HostResolutionBeginHelper(hostName, justReturnParsedIp:
true, flowContext:
false, includeIPv6:
true, throwOnIPAny:
true, requestCallback, state);
762 Logging.Exit(Logging.Sockets,
"DNS",
"UnsafeBeginGetHostAddresses", asyncResult);
775 [Obsolete(
"BeginResolve is obsoleted for this type, please use BeginGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
776 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
781 Logging.Enter(Logging.Sockets,
"DNS",
"BeginResolve", hostName);
783 IAsyncResult asyncResult = HostResolutionBeginHelper(hostName, justReturnParsedIp:
false, flowContext:
true, includeIPv6:
false, throwOnIPAny:
false, requestCallback, stateObject);
786 Logging.Exit(Logging.Sockets,
"DNS",
"BeginResolve", asyncResult);
796 [Obsolete(
"EndResolve is obsoleted for this type, please use EndGetHostEntry instead. http://go.microsoft.com/fwlink/?linkid=14202")]
801 Logging.Enter(Logging.Sockets,
"DNS",
"EndResolve", asyncResult);
806 iPHostEntry = HostResolutionEndHelper(asyncResult);
810 IPAddress address = ((ResolveAsyncResult)asyncResult).address;
817 Logging.PrintWarning(Logging.Sockets,
"DNS",
"DNS.EndResolve", ex.
Message);
819 iPHostEntry = GetUnresolveAnswer(address);
823 Logging.Exit(Logging.Sockets,
"DNS",
"EndResolve", iPHostEntry);
837 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
851 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
864 [HostProtection(
SecurityAction.LinkDemand, ExternalThreading =
true)]
870 private static IPHostEntry GetAddrInfo(
string name)
873 SocketError socketError = TryGetAddrInfo(name, out hostinfo);
874 if (socketError != 0)
881 private static SocketError TryGetAddrInfo(
string name, out IPHostEntry hostinfo)
883 return TryGetAddrInfo(name, AddressInfoHints.AI_CANONNAME, out hostinfo);
886 private unsafe
static SocketError TryGetAddrInfo(
string name, AddressInfoHints flags, out IPHostEntry hostinfo)
888 SafeFreeAddrInfo outAddrInfo =
null;
891 AddressInfo hints =
default(AddressInfo);
892 hints.ai_flags = flags;
899 hostinfo =
new IPHostEntry();
900 hostinfo.HostName = name;
901 hostinfo.Aliases =
new string[0];
902 hostinfo.AddressList =
new IPAddress[0];
905 for (AddressInfo* ptr = (AddressInfo*)(
void*)outAddrInfo.DangerousGetHandle(); ptr !=
null; ptr = ptr->ai_next)
907 if (text ==
null && ptr->ai_canonname !=
null)
913 SocketAddress socketAddress =
new SocketAddress(ptr->ai_family, ptr->ai_addrlen);
914 for (
int i = 0; i < ptr->ai_addrlen; i++)
916 socketAddress.m_Buffer[i] = ptr->ai_addr[i];
920 arrayList.
Add(((IPEndPoint)IPEndPoint.Any.Create(socketAddress)).Address);
924 arrayList.
Add(((IPEndPoint)IPEndPoint.IPv6Any.Create(socketAddress)).Address);
931 outAddrInfo?.Close();
933 hostinfo =
new IPHostEntry();
934 hostinfo.HostName = ((text !=
null) ? text : name);
935 hostinfo.Aliases =
new string[0];
936 hostinfo.AddressList =
new IPAddress[arrayList.
Count];
937 arrayList.
CopyTo(hostinfo.AddressList);
941 internal static string TryGetNameInfo(IPAddress addr, out
SocketError errorCode)
943 SocketAddress socketAddress =
new IPEndPoint(addr, 0).Serialize();
946 Socket.InitializeSockets();
947 errorCode = UnsafeNclNativeMethods.OSSOCK.GetNameInfoW(socketAddress.m_Buffer, socketAddress.m_Size, stringBuilder, stringBuilder.
Capacity,
null, 0, flags);
UriKind
Defines the kinds of T:System.Uris for the M:System.Uri.IsWellFormedUriString(System....
static new TaskFactory< TResult > Factory
Provides access to factory methods for creating and configuring T:System.Threading....
static IPHostEntry GetHostEntry(IPAddress address)
Resolves an IP address to an T:System.Net.IPHostEntry instance.
static IAsyncResult BeginGetHostAddresses(string hostNameOrAddress, AsyncCallback requestCallback, object state)
Asynchronously returns the Internet Protocol (IP) addresses for the specified host.
static IPHostEntry GetHostEntry(string hostNameOrAddress)
Resolves a host name or IP address to an T:System.Net.IPHostEntry instance.
static int ReadInt32([In] [MarshalAs(UnmanagedType.AsAny)] object ptr, int ofs)
Reads a 32-bit signed integer at a given offset from unmanaged memory.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static Task< IPHostEntry > GetHostEntryAsync(IPAddress address)
Resolves an IP address to an T:System.Net.IPHostEntry instance as an asynchronous operation.
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
override string Message
Gets the error message that is associated with this exception.
static Task< IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress)
Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
static IPHostEntry Resolve(string hostName)
Resolves a DNS host name or IP address to an T:System.Net.IPHostEntry instance.
static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback requestCallback, object stateObject)
Begins an asynchronous request for T:System.Net.IPHostEntry information about the specified DNS host ...
static readonly IPAddress Any
Provides an IP address that indicates that the server must listen for client activity on all network ...
virtual int Count
Gets the number of elements actually contained in the T:System.Collections.ArrayList.
static Task< IPHostEntry > GetHostEntryAsync(string hostNameOrAddress)
Resolves a host name or IP address to an T:System.Net.IPHostEntry instance as an asynchronous operati...
static int SizeOf(object structure)
Returns the unmanaged size of an object in bytes.
delegate void AsyncCallback(IAsyncResult ar)
References a method to be called when a corresponding asynchronous operation completes.
static bool UnsafeQueueUserWorkItem(WaitCallback callBack, object state)
Queues the specified delegate to the thread pool, but does not propagate the calling stack to the wor...
Implements the Berkeley sockets interface.
unsafe override string ToString()
Converts an Internet address to its standard notation.
virtual void Clear()
Removes all elements from the T:System.Collections.ArrayList.
static IPAddress Parse(string ipString)
Converts an IP address string to an T:System.Net.IPAddress instance.
static bool TryParse(string ipString, out IPAddress address)
Determines whether a string is a valid IP address.
Provides a container class for Internet host address information.
The exception that is thrown when a socket error occurs.
AddressFamily AddressFamily
Gets the address family of the IP address.
UriComponents
Specifies the parts of a T:System.Uri.
static IPAddress [] GetHostAddresses(string hostNameOrAddress)
Returns the Internet Protocol (IP) addresses for the specified host.
Provides an Internet Protocol (IP) address.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Represents the status of an asynchronous operation.
static IPHostEntry EndResolve(IAsyncResult asyncResult)
Ends an asynchronous request for DNS information.
static readonly IPAddress IPv6Any
The M:System.Net.Sockets.Socket.Bind(System.Net.EndPoint) method uses the F:System....
static IPHostEntry EndGetHostEntry(IAsyncResult asyncResult)
Ends an asynchronous request for DNS information.
AddressFamily
Specifies the addressing scheme that an instance of the T:System.Net.Sockets.Socket class can use.
A platform-specific type that is used to represent a pointer or a handle.
static IPHostEntry GetHostByName(string hostName)
Gets the DNS information for the specified DNS host name.
Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks,...
string HostName
Gets or sets the DNS name of the host.
Controls rights to access Domain Name System (DNS) servers on the network.
virtual void CopyTo(Array array)
Copies the entire T:System.Collections.ArrayList to a compatible one-dimensional T:System....
static IPAddress [] EndGetHostAddresses(IAsyncResult asyncResult)
Ends an asynchronous request for DNS information.
IPAddress [] AddressList
Gets or sets a list of IP addresses that are associated with a host.
static string GetHostName()
Gets the host name of the local computer.
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback requestCallback, object stateObject)
Asynchronously resolves an IP address to an T:System.Net.IPHostEntry instance.
The exception that is thrown when one of the arguments provided to a method is not valid.
void Demand()
Forces a T:System.Security.SecurityException at run time if all callers higher in the call stack have...
ProtocolFamily
Specifies the type of protocol that an instance of the T:System.Net.Sockets.Socket class can use.
static int Size
Gets the size of this instance.
UriFormat
Controls how URI information is escaped.
static unsafe string PtrToStringUni(IntPtr ptr, int len)
Allocates a managed T:System.String and copies a specified number of characters from an unmanaged Uni...
static IntPtr Add(IntPtr pointer, int offset)
Adds an offset to the value of a pointer.
int Capacity
Gets or sets the maximum number of characters that can be contained in the memory allocated by the cu...
static void PtrToStructure(IntPtr ptr, object structure)
Marshals data from an unmanaged block of memory to a managed object.
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
string [] Aliases
Gets or sets a list of aliases that are associated with a host.
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
static IPHostEntry EndGetHostByName(IAsyncResult asyncResult)
Ends an asynchronous request for DNS information.
Provides simple domain name resolution functionality.
static bool OSSupportsIPv6
Indicates whether the underlying operating system and network adaptors support Internet Protocol vers...
static IPHostEntry GetHostByAddress(string address)
Creates an T:System.Net.IPHostEntry instance from an IP address.
delegate void WaitCallback(object state)
Represents a callback method to be executed by a thread pool thread.
static unsafe string PtrToStringAnsi(IntPtr ptr)
Copies all characters up to the first null character from an unmanaged ANSI string to a managed T:Sys...
The exception that is thrown when a call is made to the M:System.Threading.Thread....
static IAsyncResult BeginGetHostEntry(string hostNameOrAddress, AsyncCallback requestCallback, object stateObject)
Asynchronously resolves a host name or IP address to an T:System.Net.IPHostEntry instance.
SocketError
Defines error codes for the T:System.Net.Sockets.Socket class.
static IPHostEntry GetHostByAddress(IPAddress address)
Creates an T:System.Net.IPHostEntry instance from the specified T:System.Net.IPAddress.
static IAsyncResult BeginResolve(string hostName, AsyncCallback requestCallback, object stateObject)
Begins an asynchronous request to resolve a DNS host name or IP address to an T:System....
static IntPtr ReadIntPtr([In] [MarshalAs(UnmanagedType.AsAny)] object ptr, int ofs)
Reads a processor native sized integer from unmanaged memory.
Provides a pool of threads that can be used to execute tasks, post work items, process asynchronous I...
Represents an asynchronous operation that can return a value.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...