Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ <h2 id="contributing">Contributing</h2>
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/Yortw/RSSDP/blob/mod/v5-rebase/src/Main/Lib/index.md/#L1" class="contribution-link">Improve this Doc</a>
<a href="https://github.com/Yortw/RSSDP/blob/fix/nuget-publish-action/src/Main/Lib/index.md/#L1" class="contribution-link">Improve this Doc</a>
</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"hash": "eWz9C1JMOjv6zeqLvYtDmDJBMO1Qx4HMSBRf+XtVIoo="
}
},
"is_incremental": true,
"is_incremental": false,
"version": ""
},
{
Expand Down Expand Up @@ -596,7 +596,7 @@
"output": {
".html": {
"relative_path": "index.html",
"hash": "f9a4x1d92blNB6PDNbfGHtTJFnV93H9sBpeptN0ZqTo="
"hash": "o/QTF3+Bv1EXy1lpacmoyd264ghCYPtHCxTYF6QSpuw="
}
},
"is_incremental": true,
Expand All @@ -622,7 +622,7 @@
"can_incremental": true,
"incrementalPhase": "build",
"total_file_count": 48,
"skipped_file_count": 14
"skipped_file_count": 11
},
"ResourceDocumentProcessor": {
"can_incremental": false,
Expand Down
6 changes: 1 addition & 5 deletions src/Main/.github/workflows/pr-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ name: RSSDP PR Gate

on:
pull_request:
branches:
- main
- master
- develop
- feature/**
types: [opened, synchronize, reopened]

jobs:
build-and-test:
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/DiscoveredSsdpDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ public override string ToString()
#region Private Methods


[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Can't call dispose on the handler since we pass it to the HttpClient, which outlives the scope of this method.")]
private static HttpClient GetDefaultClient()
{
if (s_DefaultHttpClient == null)
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/DisposableManagedObjectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public bool IsDisposed
/// <para>Sets the <see cref="IsDisposed"/> property to true. Does not explicitly throw an exception if called multiple times, but makes no promises about behaviour of derived classes.</para>
/// </remarks>
/// <seealso cref="IsDisposed"/>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly", Justification="We do exactly as asked, but CA doesn't seem to like us also setting the IsDisposed property. Too bad, it's a good idea and shouldn't cause an exception or anything likely to interfer with the dispose process.")]
public void Dispose()
{
try
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/HttpParserBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ namespace Rssdp.Infrastructure
/// <param name="headers">A reference to the <see cref="System.Net.Http.Headers.HttpHeaders"/> collection for the <paramref name="message"/> object.</param>
/// <param name="data">A string containing the data to be parsed.</param>
/// <returns>An <see cref="System.Net.Http.HttpContent"/> object containing the content of the parsed message.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Honestly, it's fine. MemoryStream doesn't mind.")]
protected virtual HttpContent Parse(T message, System.Net.Http.Headers.HttpHeaders headers, string data)
{
if (data == null) throw new ArgumentNullException(nameof(data));
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/ISocketFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public interface ISocketFactory
/// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="IUdpSocket"/> implementation.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "ip", Justification="IP is a well known and understood abbreviation and the full name is excessive.")]
IUdpSocket CreateUdpMulticastSocket(int multicastTimeToLive, int localPort);

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Main/Lib/Rssdp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Rssdp</PackageId>
<Title>Rssdp</Title>
<Version>$(VersionPrefix)5.0.0-beta3</Version>
<Version>$(VersionPrefix)5.0.0</Version>
<Authors>Troy Willmot</Authors>
<Owners>Yortw</Owners>
<Description>Really Simple Service Discovery Protocol - a 100% .Net implementation of the SSDP protocol for publishing custom/basic devices, and discovering all device types on a network.</Description>
Expand Down
2 changes: 0 additions & 2 deletions src/Main/Lib/SocketFactory.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public SocketFactory(string? ipAddress)
/// </summary>
/// <param name="localPort">An integer specifying the local port to bind the socket to.</param>
/// <returns>An implementation of the <see cref="IUdpSocket"/> interface used by RSSDP components to perform socket operations.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The purpose of this method is to create and returns a disposable result, it is up to the caller to dispose it when they are done with it.")]
public IUdpSocket CreateUdpSocket(int localPort)
{
if (localPort < 0) throw new ArgumentException("localPort cannot be less than zero.", nameof(localPort));
Expand Down Expand Up @@ -66,7 +65,6 @@ public IUdpSocket CreateUdpSocket(int localPort)
/// <param name="multicastTimeToLive">The multicast time to live value for the socket.</param>
/// <param name="localPort">The number of the local port to bind to.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "ip"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "The purpose of this method is to create and returns a disposable result, it is up to the caller to dispose it when they are done with it.")]
public IUdpSocket CreateUdpMulticastSocket(int multicastTimeToLive, int localPort)
{
if (multicastTimeToLive <= 0) throw new ArgumentException("multicastTimeToLive cannot be zero or less.", nameof(multicastTimeToLive));
Expand Down
2 changes: 0 additions & 2 deletions src/Main/Lib/SsdpCommunicationsServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ private IUdpSocket CreateSocketAndListenForResponsesAsync()
return _SendSocket;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capturing task to local variable removes compiler warning, task is not otherwise required.")]
private async void ListenToSocket(IUdpSocket socket)
{
// Tasks are captured to local variables even if we don't use them just to avoid compiler warnings.
Expand Down Expand Up @@ -349,7 +348,6 @@ await Task.Run(async () =>
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private async Task ReconnectBroadcastListeningSocket()
{
var success = false;
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/SsdpDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,6 @@ private static void ReadUntilDeviceNode(XmlReader reader)
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Yes, there is a large switch statement, not it's not really complex and doesn't really need to be rewritten at this point.")]
private bool SetPropertyFromReader(XmlReader reader, SsdpDevice device)
{
switch (reader.LocalName)
Expand Down
2 changes: 0 additions & 2 deletions src/Main/Lib/SsdpDeviceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public sealed class SsdpDeviceLocator : SsdpDeviceLocatorBase
/// <summary>
/// Default constructor. Constructs a new instance using the default <see cref="ISsdpCommunicationsServer"/> and <see cref="ISocketFactory"/> implementations for this platform.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Can't expose along exception paths here (exceptions should be very rare anyway, and probably fatal too) and we shouldn't dipose the items we pass to base in any other case.")]
public SsdpDeviceLocator() : base(new SsdpCommunicationsServer(new SocketFactory(null)))
{
// This is not the problem you are looking for;
Expand All @@ -30,7 +29,6 @@ public SsdpDeviceLocator() : base(new SsdpCommunicationsServer(new SocketFactory
/// <param name="ipAddress">The IP address of the local network adapter to bind sockets to.
/// Null or empty string will use an IP address selected by the OS or runtime.
/// </param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Can't expose along exception paths here (exceptions should be very rare anyway, and probably fatal too) and we shouldn't dipose the items we pass to base in any other case.")]
public SsdpDeviceLocator(string ipAddress) : base(new SsdpCommunicationsServer(new SocketFactory(ipAddress)))
{
// This is not the problem you are looking for;
Expand Down
3 changes: 1 addition & 2 deletions src/Main/Lib/SsdpDeviceLocatorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public Task<IEnumerable<DiscoveredSsdpDevice>> SearchAsync(TimeSpan searchWaitTi
/// <para>By design RSSDP does not support 'publishing services' as it is intended for use with non-standard UPnP devices that don't publish UPnP style services. However, it is still possible to use RSSDP to search for devices implemetning these services if you know the service type.</para>
/// </remarks>
/// <returns>A task whose result is an <see cref="IEnumerable{T}"/> of <see cref="DiscoveredSsdpDevice" /> instances, representing all found devices.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "expireTask", Justification = "Task is not actually required, but capturing to local variable suppresses compiler warning")]
public async Task<IEnumerable<DiscoveredSsdpDevice>> SearchAsync(string searchTarget, TimeSpan searchWaitTime, CancellationToken cancellationToken = default)
{
if (searchTarget == null) throw new ArgumentNullException(nameof(searchTarget));
Expand Down Expand Up @@ -208,7 +207,7 @@ public async Task<IEnumerable<DiscoveredSsdpDevice>> SearchAsync(string searchTa
_SearchResults = null;
}

var expireTask = RemoveExpiredDevicesFromCacheAsync();
_ = RemoveExpiredDevicesFromCacheAsync();
}
finally
{
Expand Down
4 changes: 0 additions & 4 deletions src/Main/Lib/SsdpDevicePublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class SsdpDevicePublisher : SsdpDevicePublisherBase
/// <remarks>
/// <para>Uses the default <see cref="ISsdpCommunicationsServer"/> implementation and network settings for Windows and the SSDP specification.</para>
/// </remarks>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "No way to do this here, and we don't want to dispose it except in the (rare) case of an exception anyway.")]
public SsdpDevicePublisher()
: this(new SsdpCommunicationsServer(new SocketFactory(null)))
{
Expand Down Expand Up @@ -59,7 +58,6 @@ public SsdpDevicePublisher(ISsdpCommunicationsServer communicationsServer, ISsdp
/// <remarks>
/// <para>Uses the default <see cref="ISsdpCommunicationsServer"/> implementation and network settings for Windows and the SSDP specification, but specifies the local port to use for socket communications. Specify 0 to indicate the system should choose it's own port.</para>
/// </remarks>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "No way to do this here, and we don't want to dispose it except in the (rare) case of an exception anyway.")]
public SsdpDevicePublisher(int localPort)
: this(new SsdpCommunicationsServer(new SocketFactory(null), localPort), new SsdpTraceLogger())
{
Expand All @@ -71,7 +69,6 @@ public SsdpDevicePublisher(int localPort)
/// </summary>
/// <param name="ipAddress">The IP address of the local network adapter to bind sockets to.
/// Null or empty string will use <see cref="IPAddress.Any"/>.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "No way to do this here, and we don't want to dispose it except in the (rare) case of an exception anyway.")]
public SsdpDevicePublisher(string ipAddress)
: this(new SsdpCommunicationsServer(new SocketFactory(ipAddress)))
{
Expand All @@ -88,7 +85,6 @@ public SsdpDevicePublisher(string ipAddress)
/// <para>Specify 0 for the <paramref name="localPort"/> argument to indicate the system should choose it's own port.</para>
/// <para>The <paramref name="multicastTimeToLive"/> is actually a number of 'hops' on the network and not a time based argument.</para>
/// </remarks>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "No way to do this here, and we don't want to dispose it except in the (rare) case of an exception anyway.")]
public SsdpDevicePublisher(int localPort, int multicastTimeToLive)
: this(new SsdpCommunicationsServer(new SocketFactory(null), localPort, multicastTimeToLive))
{
Expand Down
4 changes: 0 additions & 4 deletions src/Main/Lib/SsdpDevicePublisherBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ protected SsdpDevicePublisherBase(ISsdpCommunicationsServer communicationsServer
/// <param name="device">The <see cref="SsdpDevice"/> instance to add.</param>
/// <exception cref="System.ArgumentNullException">Thrown if the <paramref name="device"/> argument is null.</exception>
/// <exception cref="System.InvalidOperationException">Thrown if the <paramref name="device"/> contains property values that are not acceptable to the UPnP 1.0 specification.</exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capture task to local variable supresses compiler warning, but task is not really needed.")]
public void AddDevice(SsdpRootDevice device)
{
if (device == null) throw new ArgumentNullException(nameof(device));
Expand Down Expand Up @@ -719,7 +718,6 @@ private bool IsDuplicateSearchRequest(string searchTarget, UdpEndPoint endPoint)
return isDuplicateRequest;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capturing task to local variable avoids compiler warning, but value is otherwise not required.")]
private async void CleanUpRecentSearchRequestsAsync()
{
try
Expand Down Expand Up @@ -756,7 +754,6 @@ await System.Threading.Tasks.Task.Run

#region Alive

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")]
private void SendAllAliveNotifications(object? state)
{
try
Expand Down Expand Up @@ -984,7 +981,6 @@ private void SendByeByeNotifications(SsdpDevice device, bool isRoot)
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "byebye", Justification = "Correct value for this type of notification in SSDP.")]
private void SendByeByeNotification(SsdpDevice device, string notificationType, string uniqueServiceName)
{
System.Diagnostics.Activity? activity = null;
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/SsdpRootDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public Uri? UrlBase
/// Saves the property values of this device object to an a string in the full UPnP device description XML format, including child devices and outer root node and XML document declaration.
/// </summary>
/// <returns>A string containing XML in the UPnP device description format</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times", Justification = "Dispsoing memory stream twice is 'safe' and easier to read than correct code for ensuring it is only closed once.")]
public virtual string ToDescriptionDocument()
{
if (String.IsNullOrEmpty(this.Uuid)) throw new InvalidOperationException("Must provide a UUID value.");
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/SsdpService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ private static void ReadUntilServiceNode(XmlReader reader)
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Yes, there is a large switch statement, not it's not really complex and doesn't really need to be rewritten at this point.")]
private bool SetPropertyFromReader(XmlReader reader, SsdpService service)
{
switch (reader.LocalName)
Expand Down
1 change: 0 additions & 1 deletion src/Main/Lib/UdpSocket.Standard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ protected override void Dispose(bool disposing)

#region Private Methods

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exceptions via task methods should be reported by task completion source, so this should be ok.")]
private static void ProcessResponse(AsyncReceiveState state, Func<int> receiveData)
{
try
Expand Down
4 changes: 2 additions & 2 deletions src/Main/Lib/api/Rssdp.ExceptionExtensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ items:
source:
id: ExceptionExtensions
path: ''
startLine: 1208
startLine: 1206
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down Expand Up @@ -57,7 +57,7 @@ items:
source:
id: IsCritical
path: ''
startLine: 1226
startLine: 1224
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down
10 changes: 5 additions & 5 deletions src/Main/Lib/api/Rssdp.ISsdpLogger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ items:
source:
id: ISsdpLogger
path: ''
startLine: 2002
startLine: 1998
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down Expand Up @@ -48,7 +48,7 @@ items:
source:
id: LogInfo
path: ''
startLine: 2009
startLine: 2005
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down Expand Up @@ -76,7 +76,7 @@ items:
source:
id: LogVerbose
path: ''
startLine: 2015
startLine: 2011
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down Expand Up @@ -104,7 +104,7 @@ items:
source:
id: LogWarning
path: ''
startLine: 2021
startLine: 2017
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down Expand Up @@ -132,7 +132,7 @@ items:
source:
id: LogError
path: ''
startLine: 2027
startLine: 2023
assemblies:
- cs.temp.dll
namespace: Rssdp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ items:
source:
id: DisposableManagedObjectBase
path: ''
startLine: 1136
startLine: 1135
assemblies:
- cs.temp.dll
namespace: Rssdp.Infrastructure
Expand Down Expand Up @@ -68,7 +68,7 @@ items:
source:
id: Dispose
path: ''
startLine: 1145
startLine: 1144
assemblies:
- cs.temp.dll
namespace: Rssdp.Infrastructure
Expand Down Expand Up @@ -102,7 +102,7 @@ items:
source:
id: ThrowIfDisposed
path: ''
startLine: 1153
startLine: 1152
assemblies:
- cs.temp.dll
namespace: Rssdp.Infrastructure
Expand Down Expand Up @@ -141,7 +141,7 @@ items:
source:
id: IsDisposed
path: ''
startLine: 1166
startLine: 1165
assemblies:
- cs.temp.dll
namespace: Rssdp.Infrastructure
Expand Down Expand Up @@ -177,7 +177,7 @@ items:
source:
id: Dispose
path: ''
startLine: 1183
startLine: 1182
assemblies:
- cs.temp.dll
namespace: Rssdp.Infrastructure
Expand Down
Loading
Loading