Skip to content

Commit

Permalink
Use IEnumerable instead of array
Browse files Browse the repository at this point in the history
  • Loading branch information
clairernovotny committed Jun 13, 2020
1 parent 561597d commit cc11822
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Zeroconf/INetworkInterface.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -13,7 +14,7 @@ Task NetworkRequestAsync(byte[] requestBytes,
int retryDelayMilliseconds,
Action<IPAddress, byte[]> onResponse,
CancellationToken cancellationToken,
System.Net.NetworkInformation.NetworkInterface[] netInterfacesToSendRequestOn);
IEnumerable<System.Net.NetworkInformation.NetworkInterface> netInterfacesToSendRequestOn);

Task ListenForAnnouncementsAsync(Action<AdapterInformation, string, byte[]> callback, CancellationToken cancellationToken);
}
Expand Down
4 changes: 2 additions & 2 deletions Zeroconf/NetworkInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public async Task NetworkRequestAsync(byte[] requestBytes,
int retryDelayMilliseconds,
Action<IPAddress, byte[]> onResponse,
CancellationToken cancellationToken,
System.Net.NetworkInformation.NetworkInterface[] netInterfacesToSendRequestOn = null)
IEnumerable<System.Net.NetworkInformation.NetworkInterface> netInterfacesToSendRequestOn = null)
{
// populate list with all adapters if none specified
if(netInterfacesToSendRequestOn == null)
if(netInterfacesToSendRequestOn == null || !netInterfacesToSendRequestOn.Any())
{
netInterfacesToSendRequestOn = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v10.0</TargetFrameworkVersion>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
Expand Down

0 comments on commit cc11822

Please sign in to comment.