diff --git a/LICENSE b/LICENSE index aa98704..66a27ec 100644 --- a/LICENSE +++ b/LICENSE @@ -175,27 +175,3 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2006 - 2010 Intel Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Test.UPnP/Program.cs b/Test.UPnP/Program.cs index fb026a4..dd68e27 100644 --- a/Test.UPnP/Program.cs +++ b/Test.UPnP/Program.cs @@ -1,6 +1,6 @@ using System; using System.Collections; - +using System.Dynamic; using OpenSource.UPnP; using OpenSource.Utilities; @@ -84,7 +84,7 @@ private static void AddWeMoSwitch() localDevice.UserAgentTag = "redsonic"; // Create an instance of the BasicEvent service - dynamic instance = new {}; + dynamic instance = new ExpandoObject(); // Declare the "BasicEvent1" service var service = new UPnPService( diff --git a/UPnP/SSDP.cs b/UPnP/SSDP.cs index 62c8130..3d7ed69 100644 --- a/UPnP/SSDP.cs +++ b/UPnP/SSDP.cs @@ -102,7 +102,7 @@ public SSDP(int Expiration) int MinVal = (int)((double)SSDP_EXPIRATION * 0.25 * 1000); int MaxVal = (int)((double)SSDP_EXPIRATION * 0.45 * 1000); - NotifyTimer.SetTimer(5000, __NotifyCheck); + __NotifyCheck(NotifyTimer); /* NotifyTimer.Interval = RND.Next(MinVal, MaxVal); NotifyTimer.AutoReset = true; @@ -194,7 +194,8 @@ private void SetupSessions() session.JoinMulticastGroup(Utils.UpnpMulticastV4Addr, addr); try { - session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +// session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +session.Client.Disconnect(true); } catch (SocketException ex) { @@ -215,7 +216,8 @@ private void SetupSessions() usession.Client.Bind(new IPEndPoint(addr, 0)); try { - usession.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +// session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +session.Client.Disconnect(true); } catch (SocketException ex) { @@ -262,7 +264,8 @@ private void SetupSessions() session.JoinMulticastGroup((int)addr.ScopeId, Utils.UpnpMulticastV6Addr1); try { - session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +// session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +session.Client.Disconnect(true); } catch (SocketException ex) { @@ -283,7 +286,8 @@ private void SetupSessions() usession.Client.Bind(new IPEndPoint(addr, 0)); try { - usession.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +// session.Client.IOControl(SIO_UDP_CONNRESET, inValue, outValue); +session.Client.Disconnect(true); } catch (SocketException ex) { @@ -352,6 +356,8 @@ private void __NotifyCheck(SafeTimer_SINGLE sender) OnRefresh(); int MinVal = (int)((double)SSDP_EXPIRATION * 0.25 * 1000); int MaxVal = (int)((double)SSDP_EXPIRATION * 0.45 * 1000); + sender.SetTimer(5000, __NotifyCheck); + //sender.SetTimer(RND.Next(MinVal, MaxVal), __NotifyCheck); //NotifyTimer.Interval = RND.Next(MinVal, MaxVal); } diff --git a/UPnP/SafeTimer.cs b/UPnP/SafeTimer.cs index d438439..7469da8 100644 --- a/UPnP/SafeTimer.cs +++ b/UPnP/SafeTimer.cs @@ -16,7 +16,6 @@ limitations under the License. using System; using System.Threading; -using System.Collections; using OpenSource.Utilities; namespace OpenSource.UPnP @@ -128,7 +127,7 @@ System.Reflection.MethodBase method } } } - #if FINALIZER_CHECK +#if FINALIZER_CHECK ~SafeTimer() { // SWC Testing diff --git a/UPnP/UPnPDebugObject.cs b/UPnP/__UPnPDebugObject.cs similarity index 100% rename from UPnP/UPnPDebugObject.cs rename to UPnP/__UPnPDebugObject.cs diff --git a/UPnP/UPnPDeviceWatcher.cs b/UPnP/__UPnPDeviceWatcher.cs similarity index 100% rename from UPnP/UPnPDeviceWatcher.cs rename to UPnP/__UPnPDeviceWatcher.cs diff --git a/UPnP/UPnPServiceWatcher.cs b/UPnP/__UPnPServiceWatcher.cs similarity index 100% rename from UPnP/UPnPServiceWatcher.cs rename to UPnP/__UPnPServiceWatcher.cs diff --git a/UPnP/nuget_pack.ps1 b/UPnP/nuget_pack.ps1 index c066ae9..d10e622 100644 --- a/UPnP/nuget_pack.ps1 +++ b/UPnP/nuget_pack.ps1 @@ -11,7 +11,7 @@ if (-not ([string]::IsNullOrEmpty($versionStr))) { $content | Out-File $root\$project\$project.csproj - & dotnet pack $root\$project -o . + & dotnet pack -c release $root\$project -o . } else { Write-Host "Version string is empty, possibly dry run or APPVEYOR_REPO_TAG_NAME environment variable is not set"