Refactor options

This commit is contained in:
Christian Kratky
2017-10-04 13:58:51 +02:00
parent d23ab88add
commit 67267c05fd
40 changed files with 291 additions and 197 deletions
@@ -0,0 +1,19 @@
using System;
namespace MQTTnet.Core.Client
{
public static class MqttClientTcpOptionsExtensions
{
public static int GetPort(this MqttClientTcpOptions options)
{
if (options == null) throw new ArgumentNullException(nameof(options));
if (options.Port.HasValue)
{
return options.Port.Value;
}
return !options.TlsOptions.UseTls ? 1883 : 8883;
}
}
}