Fix build warnings.

This commit is contained in:
Christian
2021-12-01 20:28:59 +01:00
parent 2da2658035
commit 2d1b4b68e6
3 changed files with 11 additions and 10 deletions
+1 -2
View File
@@ -13,8 +13,7 @@ Write-Host "MSBuild path = $msbuild"
Write-Host Write-Host
# Cleanup # Cleanup
Remove-Item -Path ".\..\" -Filter "*.nupkg" Get-ChildItem -Path ".\..\" -Filter "*.nupkg" -Recurse | Remove-Item
Remove-Item -Path ".\..\" -Filter "*.snupkg"
# Build and execute tests # Build and execute tests
&$msbuild ..\Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj /t:Clean /t:Restore /t:Build /p:Configuration="Release" /p:TargetFramework="net5.0" /verbosity:m &$msbuild ..\Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj /t:Clean /t:Restore /t:Build /p:Configuration="Release" /p:TargetFramework="net5.0" /verbosity:m
@@ -13,8 +13,7 @@ namespace MQTTnet.Implementations
{ {
public sealed class MqttTcpServerAdapter : IMqttServerAdapter public sealed class MqttTcpServerAdapter : IMqttServerAdapter
{ {
readonly MqttNetSourceLogger _logger; MqttNetSourceLogger _logger;
readonly IMqttNetLogger _rootLogger;
MqttServerOptions _options; MqttServerOptions _options;
StreamSocketListener _listener; StreamSocketListener _listener;
@@ -25,6 +24,9 @@ namespace MQTTnet.Implementations
{ {
if (_listener != null) throw new InvalidOperationException("Server is already started."); if (_listener != null) throw new InvalidOperationException("Server is already started.");
if (logger is null) throw new ArgumentNullException(nameof(logger));
_logger = logger.WithSource(nameof(MqttTcpServerAdapter));
_options = options ?? throw new ArgumentNullException(nameof(options)); _options = options ?? throw new ArgumentNullException(nameof(options));
if (options.DefaultEndpointOptions.IsEnabled) if (options.DefaultEndpointOptions.IsEnabled)
@@ -1,4 +1,4 @@
#if !WINDOWS_UWP #if !WINDOWS_UWP
using MQTTnet.Adapter; using MQTTnet.Adapter;
using MQTTnet.Diagnostics; using MQTTnet.Diagnostics;
using MQTTnet.Server; using MQTTnet.Server;