Quellcode durchsuchen

Bug fixes

release/3.x.x
1iveowl vor 7 Jahren
Ursprung
Commit
07fd509e74
5 geänderte Dateien mit 22 neuen und 22 gelöschten Zeilen
  1. +1
    -1
      Build/MQTTnet.nuspec
  2. +1
    -1
      Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj
  3. +0
    -5
      Frameworks/MQTTnet.UniversalWindows/MQTTnet.UniversalWindows.csproj
  4. +19
    -15
      MQTTnet.Core/Adapter/MqttChannelCommunicationAdapter.cs
  5. +1
    -0
      MQTTnet.Core/Client/MqttClient.cs

+ 1
- 1
Build/MQTTnet.nuspec Datei anzeigen

@@ -24,7 +24,7 @@

<group targetFramework="netstandard1.3">
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="System.Net.Security" version="4.3.1" />
<dependency id="System.Net.Security" version="4.3.2" />
</group>
<group targetFramework="uap10.0">


+ 1
- 1
Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj Datei anzeigen

@@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Net.Security" Version="4.3.1" />
<PackageReference Include="System.Net.Security" Version="4.3.2" />
<PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
<PackageReference Include="System.Net.WebSockets.Client" Version="4.3.1" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />


+ 0
- 5
Frameworks/MQTTnet.UniversalWindows/MQTTnet.UniversalWindows.csproj Datei anzeigen

@@ -130,11 +130,6 @@
<Version>5.4.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System.Net.Security">
<HintPath>..\..\..\..\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Security.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>


+ 19
- 15
MQTTnet.Core/Adapter/MqttChannelCommunicationAdapter.cs Datei anzeigen

@@ -83,35 +83,39 @@ namespace MQTTnet.Core.Adapter
{
foreach (var packet in packets)
{
MqttTrace.Information(nameof(MqttChannelCommunicationAdapter), "TX >>> {0} [Timeout={1}]", packet, timeout);
if (packet == null) continue;

MqttTrace.Information(nameof(MqttChannelCommunicationAdapter), $"TX >>> {packet} [Timeout={timeout}]");

var writeBuffer = PacketSerializer.Serialize(packet);
_sendTask = _sendTask.ContinueWith(p => _channel.SendStream.WriteAsync(writeBuffer, 0, writeBuffer.Length, cancellationToken).ConfigureAwait(false), cancellationToken);
}

if (timeout > TimeSpan.Zero)
{
_sendTask = _sendTask.ContinueWith(c => _channel.SendStream.FlushAsync(cancellationToken).TimeoutAfter(timeout), cancellationToken);// _channel.SendStream.FlushAsync(cancellationToken).TimeoutAfter(timeout);//.ConfigureAwait(false);
}
else
{
_sendTask = _sendTask.ContinueWith(c => _channel.SendStream.FlushAsync(cancellationToken), cancellationToken);
}

}

await _sendTask; // configure await false generates stackoverflow

if (timeout > TimeSpan.Zero)
{
await _channel.SendStream.FlushAsync(cancellationToken).TimeoutAfter(timeout).ConfigureAwait(false);
}
else
{
await _channel.SendStream.FlushAsync(cancellationToken).ConfigureAwait(false);
}
}
catch (TaskCanceledException)
catch (TaskCanceledException ex)
{
throw;
throw ex;
}
catch (MqttCommunicationTimedOutException)
catch (MqttCommunicationTimedOutException ex)
{
throw;
throw ex;
}
catch (MqttCommunicationException)
catch (MqttCommunicationException ex)
{
throw;
throw ex;
}
catch (Exception exception)
{


+ 1
- 0
MQTTnet.Core/Client/MqttClient.cs Datei anzeigen

@@ -63,6 +63,7 @@ namespace MQTTnet.Core.Client
};

var response = await SendAndReceiveAsync<MqttConnAckPacket>(connectPacket).ConfigureAwait(false);
if (response.ConnectReturnCode != MqttConnectReturnCode.ConnectionAccepted)
{
throw new MqttConnectingFailedException(response.ConnectReturnCode);


Laden…
Abbrechen
Speichern