Skip to content

Commit

Permalink
Added netstandard2.0 target. Fixes exception in UPnPControlPoint.cs.
Browse files Browse the repository at this point in the history
  • Loading branch information
genemars committed Dec 26, 2022
1 parent f0a18b6 commit fd6dfbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion UPnP/UPnP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<PackageTags>upnp dlna ssdp</PackageTags>
<RuntimeIdentifiers>win8-arm;linux-arm;win10-x64;osx.10.11-x64;linux-x64</RuntimeIdentifiers>
<OutputType>Library</OutputType>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>
</Project>
11 changes: 9 additions & 2 deletions UPnP/UPnPControlPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,15 @@ public void OnReceiveSink(IAsyncResult ar)
}
if (client.Client != null)
{
IPEndPoint local = (IPEndPoint)client.Client.LocalEndPoint;
SSDPSessions.Remove(local.Address);
try
{
IPEndPoint local = (IPEndPoint)client.Client.LocalEndPoint;
SSDPSessions.Remove(local.Address);
}
catch (Exception ex)
{
OpenSource.Utilities.EventLogger.Log(ex);
}
}
client.Close();
}
Expand Down

0 comments on commit fd6dfbf

Please sign in to comment.