@@ -57,7 +57,7 @@ | |||||
<dependency id="System.Net.WebSockets.Client" version="4.3.2" /> | <dependency id="System.Net.WebSockets.Client" version="4.3.2" /> | ||||
</group> | </group> | ||||
<group targetFramework="uap10.0"> | <group targetFramework="uap10.0"> | ||||
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.1.9" /> | |||||
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.2.8" /> | |||||
</group> | </group> | ||||
<group targetFramework="net452"> | <group targetFramework="net452"> | ||||
</group> | </group> | ||||
@@ -1,7 +1,7 @@ | |||||
| | ||||
Microsoft Visual Studio Solution File, Format Version 12.00 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
# Visual Studio 15 | |||||
VisualStudioVersion = 15.0.27004.2010 | |||||
# Visual Studio Version 16 | |||||
VisualStudioVersion = 16.0.28729.10 | |||||
MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.Tests", "Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj", "{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.Tests", "Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj", "{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}" | ||||
EndProject | EndProject | ||||
@@ -44,9 +44,9 @@ namespace MQTTnet.AspNetCore | |||||
clientCertificate?.Dispose(); | clientCertificate?.Dispose(); | ||||
var channel = new MqttWebSocketChannel(webSocket, endpoint, isSecureConnection); | var channel = new MqttWebSocketChannel(webSocket, endpoint, isSecureConnection); | ||||
var clientAdapter = new MqttChannelAdapter(channel, new MqttPacketFormatterAdapter(), _logger.CreateChildLogger(nameof(MqttWebSocketServerAdapter))); | |||||
var channelAdapter = new MqttChannelAdapter(channel, new MqttPacketFormatterAdapter(), _logger.CreateChildLogger(nameof(MqttWebSocketServerAdapter))); | |||||
var eventArgs = new MqttServerAdapterClientAcceptedEventArgs(clientAdapter); | |||||
var eventArgs = new MqttServerAdapterClientAcceptedEventArgs(channelAdapter); | |||||
ClientAcceptedHandler?.Invoke(eventArgs); | ClientAcceptedHandler?.Invoke(eventArgs); | ||||
if (eventArgs.SessionTask != null) | if (eventArgs.SessionTask != null) | ||||
@@ -20,19 +20,22 @@ namespace MQTTnet.Formatter | |||||
UseProtocolVersion(protocolVersion); | UseProtocolVersion(protocolVersion); | ||||
} | } | ||||
public MqttProtocolVersion ProtocolVersion { get; private set; } | |||||
public MqttProtocolVersion ProtocolVersion { get; private set; } = MqttProtocolVersion.Unknown; | |||||
public IMqttDataConverter DataConverter | public IMqttDataConverter DataConverter | ||||
{ | { | ||||
get | get | ||||
{ | { | ||||
ThrowIfFormatterNotSet(); | ThrowIfFormatterNotSet(); | ||||
return _formatter.DataConverter; | return _formatter.DataConverter; | ||||
} | } | ||||
} | } | ||||
public ArraySegment<byte> Encode(MqttBasePacket packet) | public ArraySegment<byte> Encode(MqttBasePacket packet) | ||||
{ | { | ||||
if (packet == null) throw new ArgumentNullException(nameof(packet)); | |||||
ThrowIfFormatterNotSet(); | ThrowIfFormatterNotSet(); | ||||
return _formatter.Encode(packet); | return _formatter.Encode(packet); | ||||
@@ -40,6 +43,8 @@ namespace MQTTnet.Formatter | |||||
public MqttBasePacket Decode(ReceivedMqttPacket receivedMqttPacket) | public MqttBasePacket Decode(ReceivedMqttPacket receivedMqttPacket) | ||||
{ | { | ||||
if (receivedMqttPacket == null) throw new ArgumentNullException(nameof(receivedMqttPacket)); | |||||
ThrowIfFormatterNotSet(); | ThrowIfFormatterNotSet(); | ||||
return _formatter.Decode(receivedMqttPacket); | return _formatter.Decode(receivedMqttPacket); | ||||
@@ -54,7 +54,7 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup Condition="'$(TargetFramework)'=='uap10.0'"> | <ItemGroup Condition="'$(TargetFramework)'=='uap10.0'"> | ||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" /> | |||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.8" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup Condition="'$(TargetFramework)'=='net452'"> | <ItemGroup Condition="'$(TargetFramework)'=='net452'"> | ||||
@@ -62,9 +62,5 @@ | |||||
<ItemGroup Condition="'$(TargetFramework)'=='net461'"> | <ItemGroup Condition="'$(TargetFramework)'=='net461'"> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.2" /> | |||||
</ItemGroup> | |||||
</Project> | </Project> |
@@ -7,7 +7,7 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | |||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" /> | |||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | ||||
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | <PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -9,7 +9,7 @@ | |||||
</PropertyGroup> | </PropertyGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.3" /> | |||||
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" /> | |||||
<PackageReference Include="System.IO.Pipelines" Version="4.5.2" /> | <PackageReference Include="System.IO.Pipelines" Version="4.5.2" /> | ||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.6" /> | <PackageReference Include="Microsoft.AspNetCore" Version="2.1.6" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -9,7 +9,7 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | ||||
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | <PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | ||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" /> | |||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" /> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -12,7 +12,7 @@ | |||||
<DefaultLanguage>en-US</DefaultLanguage> | <DefaultLanguage>en-US</DefaultLanguage> | ||||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> | <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> | ||||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion> | <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion> | ||||
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion> | |||||
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion> | |||||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> | <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> | ||||
<FileAlignment>512</FileAlignment> | <FileAlignment>512</FileAlignment> | ||||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||||
@@ -142,10 +142,10 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> | <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> | ||||
<Version>6.2.2</Version> | |||||
<Version>6.2.8</Version> | |||||
</PackageReference> | </PackageReference> | ||||
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> | <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls"> | ||||
<Version>5.0.0</Version> | |||||
<Version>4.0.0</Version> | |||||
</PackageReference> | </PackageReference> | ||||
</ItemGroup> | </ItemGroup> | ||||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> | <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> | ||||