mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 19:13:11 +08:00
Refactor namings of serializers etc.
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
<RowDefinition></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="0">Server:</TextBlock>
|
||||
@@ -57,12 +58,19 @@
|
||||
<TextBlock Grid.Column="0" Grid.Row="5">Keep Alive interval:</TextBlock>
|
||||
<TextBox Grid.Column="1" Grid.Row="5" x:Name="KeepAliveInterval" Text="5"></TextBox>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="6">Protocol:</TextBlock>
|
||||
<TextBlock Grid.Column="0" Grid.Row="6">Transport:</TextBlock>
|
||||
<StackPanel Grid.Column="1" Grid.Row="6" Orientation="Horizontal">
|
||||
<RadioButton x:Name="UseTcp" IsChecked="True" GroupName="connection">TCP</RadioButton>
|
||||
<RadioButton x:Name="UseWs" GroupName="connection">WS</RadioButton>
|
||||
<RadioButton x:Name="UseTcp" IsChecked="True" GroupName="transport">TCP</RadioButton>
|
||||
<RadioButton x:Name="UseWs" GroupName="transport">WS</RadioButton>
|
||||
<CheckBox x:Name="UseTls">Use TLS</CheckBox>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="7">Protocol:</TextBlock>
|
||||
<StackPanel Grid.Column="1" Grid.Row="7" Orientation="Horizontal">
|
||||
<RadioButton x:Name="UseMqtt500" GroupName="protocol">5.0.0</RadioButton>
|
||||
<RadioButton x:Name="UseMqtt311" GroupName="protocol" IsChecked="True">3.1.1</RadioButton>
|
||||
<RadioButton x:Name="UseMqtt310" GroupName="protocol">3.1.0</RadioButton>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<CheckBox x:Name="CleanSession" IsChecked="True">Clean session</CheckBox>
|
||||
|
||||
@@ -12,9 +12,9 @@ using MQTTnet.Diagnostics;
|
||||
using MQTTnet.Exceptions;
|
||||
using MQTTnet.Extensions.ManagedClient;
|
||||
using MQTTnet.Extensions.Rpc;
|
||||
using MQTTnet.Formatter;
|
||||
using MQTTnet.Implementations;
|
||||
using MQTTnet.Protocol;
|
||||
using MQTTnet.Serializer;
|
||||
using MQTTnet.Server;
|
||||
using MqttClientConnectedEventArgs = MQTTnet.Client.MqttClientConnectedEventArgs;
|
||||
using MqttClientDisconnectedEventArgs = MQTTnet.Client.MqttClientDisconnectedEventArgs;
|
||||
@@ -124,7 +124,20 @@ namespace MQTTnet.TestApp.UniversalWindows
|
||||
|
||||
options.CleanSession = CleanSession.IsChecked == true;
|
||||
options.KeepAlivePeriod = TimeSpan.FromSeconds(double.Parse(KeepAliveInterval.Text));
|
||||
|
||||
|
||||
if (UseMqtt310.IsChecked == true)
|
||||
{
|
||||
options.ProtocolVersion = MqttProtocolVersion.V310;
|
||||
}
|
||||
else if (UseMqtt311.IsChecked == true)
|
||||
{
|
||||
options.ProtocolVersion = MqttProtocolVersion.V311;
|
||||
}
|
||||
else if (UseMqtt500.IsChecked == true)
|
||||
{
|
||||
options.ProtocolVersion = MqttProtocolVersion.V500;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (_mqttClient != null)
|
||||
@@ -426,14 +439,14 @@ namespace MQTTnet.TestApp.UniversalWindows
|
||||
_sessions.Clear();
|
||||
}
|
||||
|
||||
private async void RefreshSessions(object sender, RoutedEventArgs e)
|
||||
private void RefreshSessions(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_mqttServer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var sessions = await _mqttServer.GetClientSessionsStatusAsync();
|
||||
var sessions = _mqttServer.GetClientSessionsStatus();
|
||||
_sessions.Clear();
|
||||
|
||||
foreach (var session in sessions)
|
||||
|
||||
Reference in New Issue
Block a user