Skip to content

Commit ae0ab54

Browse files
committed
[OPC] Wrap get endpoints in a task
1 parent 01291ac commit ae0ab54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PlcInterface.OpcUa/PlcConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public async Task<bool> ConnectAsync()
9595
await config.Validate(ApplicationType.Client).ConfigureAwait(false);
9696
var usesSecurity = await SetupSecurityAsync(config).ConfigureAwait(false);
9797
LogFindingEndpoint(settings.DiscoveryAddress);
98-
var selectedEndpoint = CoreClientUtils.SelectEndpoint(settings.DiscoveryAddress.ToString(), usesSecurity, 15000);
98+
var selectedEndpoint = await Task.Run(() => CoreClientUtils.SelectEndpoint(settings.DiscoveryAddress.ToString(), usesSecurity, 15000)).ConfigureAwait(false);
9999
LogSelectedSecurity(selectedEndpoint.SecurityPolicyUri[(selectedEndpoint.SecurityPolicyUri.LastIndexOf('#') + 1)..]);
100100
LogCreateSession();
101101
var endpointConfiguration = EndpointConfiguration.Create(config);

0 commit comments

Comments
 (0)