iotgateway/Plugins/Plugin/UAService.cs

32 lines
835 B
C#
Raw Normal View History

2022-08-10 08:55:44 +00:00
using Quickstarts;
2021-12-23 08:22:03 +00:00
using Quickstarts.ReferenceServer;
namespace Plugin
{
public class UAService :IDisposable
2021-12-23 08:22:03 +00:00
{
string applicationName = "ConsoleReferenceServer";
string configSectionName = "Quickstarts.ReferenceServer";
public UAServer<ReferenceServer> server = null;
2021-12-23 08:22:03 +00:00
public UAService()
2021-12-23 08:22:03 +00:00
{
server = new UAServer<ReferenceServer>(null)
{
AutoAccept = false,
Password = null
};
server.LoadAsync(applicationName, configSectionName).ConfigureAwait(false);
server.CheckCertificateAsync(false).ConfigureAwait(false);
server.StartAsync().ConfigureAwait(false);
}
public void Dispose()
2021-12-23 08:22:03 +00:00
{
server.StopAsync().ConfigureAwait(false);
}
}
}