From 2cdad6622ab2e82796653a6d5a7adadc5f278217 Mon Sep 17 00:00:00 2001 From: Christian <6939810+chkr1011@users.noreply.github.com> Date: Sun, 14 May 2023 09:14:37 +0200 Subject: [PATCH] Fix build --- .../MQTTnet/Client/Options/MqttClientWebSocketOptions.cs | 8 ++++++++ Source/MQTTnet/Implementations/MqttWebSocketChannel.cs | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/MQTTnet/Client/Options/MqttClientWebSocketOptions.cs b/Source/MQTTnet/Client/Options/MqttClientWebSocketOptions.cs index 0b386675..d35f7f00 100644 --- a/Source/MQTTnet/Client/Options/MqttClientWebSocketOptions.cs +++ b/Source/MQTTnet/Client/Options/MqttClientWebSocketOptions.cs @@ -31,6 +31,7 @@ namespace MQTTnet.Client } #if !NETSTANDARD1_3 +#if !WINDOWS_UWP /// /// Gets or sets the keep alive interval for the Web Socket connection. /// This is not related to the keep alive interval for the MQTT protocol. @@ -42,6 +43,13 @@ namespace MQTTnet.Client /// This is not related to the credentials which are used for the MQTT protocol. /// public bool UseDefaultCredentials { get; set; } +#else + /// + /// Gets or sets the keep alive interval for the Web Socket connection. + /// This is not related to the keep alive interval for the MQTT protocol. + /// + public TimeSpan KeepAliveInterval { get; set; } = TimeSpan.FromSeconds(30); +#endif #endif } } \ No newline at end of file diff --git a/Source/MQTTnet/Implementations/MqttWebSocketChannel.cs b/Source/MQTTnet/Implementations/MqttWebSocketChannel.cs index 900b292b..6ee5b451 100644 --- a/Source/MQTTnet/Implementations/MqttWebSocketChannel.cs +++ b/Source/MQTTnet/Implementations/MqttWebSocketChannel.cs @@ -218,9 +218,11 @@ namespace MQTTnet.Implementations #endif } } - + #if !NETSTANDARD1_3 +#if !WINDOWS_UWP clientWebSocket.Options.UseDefaultCredentials = _options.UseDefaultCredentials; +#endif clientWebSocket.Options.KeepAliveInterval = _options.KeepAliveInterval; #endif clientWebSocket.Options.Credentials = _options.Credentials;