Skip to content

Commit

Permalink
[OPC] Wrap get endpoints in a task
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectron committed Nov 15, 2024
1 parent 01291ac commit ae0ab54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PlcInterface.OpcUa/PlcConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async Task<bool> ConnectAsync()
await config.Validate(ApplicationType.Client).ConfigureAwait(false);
var usesSecurity = await SetupSecurityAsync(config).ConfigureAwait(false);
LogFindingEndpoint(settings.DiscoveryAddress);
var selectedEndpoint = CoreClientUtils.SelectEndpoint(settings.DiscoveryAddress.ToString(), usesSecurity, 15000);
var selectedEndpoint = await Task.Run(() => CoreClientUtils.SelectEndpoint(settings.DiscoveryAddress.ToString(), usesSecurity, 15000)).ConfigureAwait(false);
LogSelectedSecurity(selectedEndpoint.SecurityPolicyUri[(selectedEndpoint.SecurityPolicyUri.LastIndexOf('#') + 1)..]);
LogCreateSession();
var endpointConfiguration = EndpointConfiguration.Create(config);
Expand Down

0 comments on commit ae0ab54

Please sign in to comment.