Skip to content

Commit

Permalink
Add IPv6 support (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
bruinsg authored Apr 21, 2023
1 parent 6163087 commit 7458c0b
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 122 deletions.
12 changes: 12 additions & 0 deletions samples/ServiceFinder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,24 @@ static void Main(string[] args)
serviceBrowser.ServiceAdded += onServiceAdded;
serviceBrowser.ServiceRemoved += onServiceRemoved;
serviceBrowser.ServiceChanged += onServiceChanged;
serviceBrowser.NetworkInterfaceAdded += OnNetworkInterfaceAdded;
serviceBrowser.NetworkInterfaceRemoved += OnNetworkInterfaceRemoved;

Console.WriteLine("Browsing for type: {0}", serviceType);
serviceBrowser.StartBrowse(serviceType);
Console.ReadLine();
}

static void OnNetworkInterfaceAdded(object sender, NetworkInterfaceEventArgs e)
{
Console.WriteLine($"OnNetworkInterfaceAdded {e.NetworkInterface.Name}");
}

static void OnNetworkInterfaceRemoved(object sender, NetworkInterfaceEventArgs e)
{
Console.WriteLine($"OnNetworkInterfaceRemoved {e.NetworkInterface.Name}");
}

static void onServiceChanged(object sender, ServiceAnnouncementEventArgs e)
{
printService('~', e.Announcement);
Expand Down
4 changes: 2 additions & 2 deletions samples/ServiceFinder/ServiceFinder.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<ItemGroup>
<ProjectReference Include="..\..\src\Tmds.MDns\Tmds.MDns.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>

</Project>
Loading

0 comments on commit 7458c0b

Please sign in to comment.