Expose more properties of the connection validator context in MQTTnet.Server. Migrate return code to reason code.

This commit is contained in:
Christian Kratky
2019-06-14 20:38:07 +02:00
parent bd665c3d56
commit 0c7a5a992b
9 changed files with 73 additions and 36 deletions
@@ -35,7 +35,7 @@ namespace MQTTnet.Server.Mqtt
return;
}
_path = ExpandPath();
_path = PathHelper.ExpandPath(_mqttSettings.RetainedApplicationMessages.Path);
// The retained application messages are stored in a separate thread.
// This is mandatory because writing them to a slow storage (like RaspberryPi SD card)
@@ -115,18 +115,5 @@ namespace MQTTnet.Server.Mqtt
return null;
}
}
private string ExpandPath()
{
var path = _mqttSettings.RetainedApplicationMessages.Path;
var uri = new Uri(path, UriKind.RelativeOrAbsolute);
if (!uri.IsAbsoluteUri)
{
path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
}
return path;
}
}
}