Skip to content

Commit

Permalink
change dotnet core dependencies from rc2 to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tmds committed Jun 28, 2016
1 parent 38291d4 commit 039c84b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 32 deletions.
4 changes: 2 additions & 2 deletions samples/ServiceFinder/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"emitEntryPoint": true
},
"dependencies": {
"Tmds.MDns": "0.4.0",
"Tmds.MDns": "0.5.0",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002702"
"version": "1.0.0"
}
},
"frameworks": {
Expand Down
24 changes: 3 additions & 21 deletions src/Tmds.MDns/ServiceBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ internal void OnServiceAdded(ServiceInfo service)
};
lock (_serviceAnnouncements)
{
_serviceAnnouncements.Add(Tuple.Create(GetId(service.NetworkInterface), service.Name), announcement);
_serviceAnnouncements.Add(Tuple.Create(service.NetworkInterface.Id, service.Name), announcement);
}
SynchronizationContextPost(o =>
{
Expand All @@ -127,7 +127,7 @@ internal void OnServiceAdded(ServiceInfo service)

internal void OnServiceRemoved(ServiceInfo service)
{
var key = Tuple.Create(GetId(service.NetworkInterface), service.Name);
var key = Tuple.Create(service.NetworkInterface.Id, service.Name);
ServiceAnnouncement announcement;
lock (_serviceAnnouncements)
{
Expand Down Expand Up @@ -175,7 +175,7 @@ internal void OnServiceChanged(ServiceInfo service)
ServiceAnnouncement announcement;
lock (_serviceAnnouncements)
{
announcement = _serviceAnnouncements[Tuple.Create(GetId(service.NetworkInterface), service.Name)];
announcement = _serviceAnnouncements[Tuple.Create(service.NetworkInterface.Id, service.Name)];
}
var tmpAnnouncement = new ServiceAnnouncement()
{
Expand Down Expand Up @@ -287,24 +287,6 @@ private void SynchronizationContextPost(SendOrPostCallback cb)
cb(null);
}
}

// https://github.com/dotnet/corefx/issues/8297
private static bool _idSupported = true;
private string GetId(NetworkInterface interf)
{
if (_idSupported)
{
try
{
return interf.Id;
}
catch (PlatformNotSupportedException)
{
_idSupported = false;
}
}
return interf.Name;
}

private readonly HashSet<ServiceAnnouncement> _services = new HashSet<ServiceAnnouncement>();
private readonly Dictionary<Tuple<string, Name>, ServiceAnnouncement> _serviceAnnouncements = new Dictionary<Tuple<string, Name>, ServiceAnnouncement>();
Expand Down
18 changes: 9 additions & 9 deletions src/Tmds.MDns/project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.4.0",
"version": "0.5.0",
"packOptions": {
"tags": [ "mdns", "avahi", "zeroconf", "rfc6762", "rfc6763" ],
"repository": {
Expand All @@ -15,14 +15,14 @@
"frameworks": {
"netstandard1.5": {
"dependencies": {
"System.Net.NetworkInformation": "4.1.0-rc2-24027",
"System.Net.Sockets" : "4.1.0-rc2-24027",
"System.Linq": "4.1.0-rc2-24027",
"System.Threading": "4.0.11-rc2-24027",
"System.Threading.Timer": "4.0.1-rc2-24027",
"System.Text.Encoding": "4.0.11-rc2-24027",
"System.Runtime.Extensions": "4.1.0-rc2-24027",
"System.Diagnostics.Debug": "4.0.11-rc2-24027"
"System.Net.NetworkInformation": "4.1.0",
"System.Net.Sockets" : "4.1.0",
"System.Linq": "4.1.0",
"System.Threading": "4.0.11",
"System.Threading.Timer": "4.0.1",
"System.Text.Encoding": "4.0.11",
"System.Runtime.Extensions": "4.1.0",
"System.Diagnostics.Debug": "4.0.11"
}
},
"net45": { },
Expand Down

0 comments on commit 039c84b

Please sign in to comment.