mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Add validations for client options builder.
This commit is contained in:
@@ -15,6 +15,11 @@ namespace MQTTnet.Client.Options
|
||||
|
||||
public MqttClientOptionsBuilder WithProtocolVersion(MqttProtocolVersion value)
|
||||
{
|
||||
if (value == MqttProtocolVersion.Unknown)
|
||||
{
|
||||
throw new ArgumentException("Protocol version is invalid.");
|
||||
}
|
||||
|
||||
_options.ProtocolVersion = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user