Skip to content

Commit

Permalink
#if out Delegate.BeginInvoke/EndInvoke usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mjrousos committed Nov 28, 2018
1 parent c6668db commit 6f41f99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/NETworkManager.Core/NETworkManager.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<ApplicationIcon>NETworkManager.ico</ApplicationIcon>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
</PropertyGroup>

<!-- Pre/Post build events should be migrated to be targets (as per https://github.com/dotnet/sdk/issues/1055) -->
Expand Down
13 changes: 12 additions & 1 deletion Source/NETworkManager/3rdParty/Heijden.DNS/Resolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
using System.Text;
using System.Net.Sockets;
using System.Net.NetworkInformation;

#if !NETCORE
using System.Runtime.Remoting.Messaging;
#endif


/*
Expand Down Expand Up @@ -674,6 +677,7 @@ public IPAddress[] GetHostAddresses(string hostNameOrAddress)

private delegate IPAddress[] GetHostAddressesDelegate(string hostNameOrAddress);

#if !NETCORE // .NET Core doesn't support AsyncResult or BeginInvoke/EndInvoke
/// <summary>
/// Asynchronously returns the Internet Protocol (IP) addresses for the specified
/// host.
Expand Down Expand Up @@ -708,6 +712,7 @@ public IPAddress[] EndGetHostAddresses(IAsyncResult AsyncResult)
GetHostAddressesDelegate g = (GetHostAddressesDelegate)aResult.AsyncDelegate;
return g.EndInvoke(AsyncResult);
}
#endif // !NETCORE

/// <summary>
/// Creates an System.Net.IPHostEntry instance from the specified System.Net.IPAddress.
Expand Down Expand Up @@ -741,6 +746,7 @@ public IPHostEntry GetHostByName(string hostName)

private delegate IPHostEntry GetHostByNameDelegate(string hostName);

#if !NETCORE // .NET Core doesn't support AsyncResult or BeginInvoke/EndInvoke
/// <summary>
/// Asynchronously resolves an IP address to an System.Net.IPHostEntry instance.
/// </summary>
Expand Down Expand Up @@ -771,6 +777,7 @@ public IPHostEntry EndGetHostByName(IAsyncResult AsyncResult)
GetHostByNameDelegate g = (GetHostByNameDelegate)aResult.AsyncDelegate;
return g.EndInvoke(AsyncResult);
}
#endif // !NETCORE

/// <summary>
/// Resolves a host name or IP address to an System.Net.IPHostEntry instance.
Expand All @@ -785,6 +792,7 @@ public IPHostEntry Resolve(string hostName)

private delegate IPHostEntry ResolveDelegate(string hostName);

#if !NETCORE // .NET Core doesn't support AsyncResult or BeginInvoke/EndInvoke
/// <summary>
/// Begins an asynchronous request to resolve a DNS host name or IP address to
/// an System.Net.IPAddress instance.
Expand Down Expand Up @@ -819,7 +827,8 @@ public IPHostEntry EndResolve(IAsyncResult AsyncResult)
ResolveDelegate g = (ResolveDelegate)aResult.AsyncDelegate;
return g.EndInvoke(AsyncResult);
}
#endregion
#endif // !NETCORE
#endregion

/// <summary>
/// Resolves an IP address to an System.Net.IPHostEntry instance.
Expand Down Expand Up @@ -858,6 +867,7 @@ public IPHostEntry GetHostEntry(string hostNameOrAddress)
private delegate IPHostEntry GetHostEntryViaIPDelegate(IPAddress ip);
private delegate IPHostEntry GetHostEntryDelegate(string hostNameOrAddress);

#if !NETCORE // .NET Core doesn't support AsyncResult or BeginInvoke/EndInvoke
/// <summary>
/// Asynchronously resolves a host name or IP address to an System.Net.IPHostEntry instance.
/// </summary>
Expand Down Expand Up @@ -922,6 +932,7 @@ public IPHostEntry EndGetHostEntry(IAsyncResult AsyncResult)
}
return null;
}
#endif // !NETCORE

private enum RRRecordStatus
{
Expand Down

0 comments on commit 6f41f99

Please sign in to comment.