Skip to content

Commit

Permalink
Fix build on merged commits
Browse files Browse the repository at this point in the history
  • Loading branch information
mregen committed Jun 27, 2023
1 parent ae00175 commit 49c8532
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Applications/ConsoleReferenceClient/UAClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public async Task<bool> ConnectAsync(string serverUrl, bool useSecurity = true,
using (var cts = new CancellationTokenSource(30_000))
using (var linkedCTS = CancellationTokenSource.CreateLinkedTokenSource(ct, cts.Token))
{
connection = await m_reverseConnectManager.WaitForConnection(new Uri(serverUrl), null, linkedCTS.Token);
connection = await m_reverseConnectManager.WaitForConnection(new Uri(serverUrl), null, linkedCTS.Token).ConfigureAwait(false);
if (connection == null)
{
throw new ServiceResultException(StatusCodes.BadTimeout, "Waiting for a reverse connection timed out.");
Expand Down
25 changes: 2 additions & 23 deletions Stack/Opc.Ua.Core/Stack/Client/DiscoveryClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,10 @@ public virtual EndpointDescriptionCollection GetEndpoints(StringCollection profi
/// Invokes the GetEndpoints service async.
/// </summary>
/// <param name="profileUris">The collection of profile URIs.</param>
/// <returns></returns>
public async virtual Task<EndpointDescriptionCollection> GetEndpointsAsync(StringCollection profileUris)
{
var endpoints = await GetEndpointsAsync(null, this.Endpoint.EndpointUrl, null, profileUris).ConfigureAwait(false);
return PatchEndpointUrls(endpoints);
var response = await GetEndpointsAsync(null, this.Endpoint.EndpointUrl, null, profileUris, CancellationToken.None).ConfigureAwait(false);
return PatchEndpointUrls(response.Endpoints);
}

/// <summary>
Expand Down Expand Up @@ -237,26 +236,6 @@ public virtual async Task<ApplicationDescriptionCollection> FindServersAsync(Str
#endregion

#region Private Methods
/// <summary>
/// Helper to get endpoints async.
/// </summary>
private Task<EndpointDescriptionCollection> GetEndpointsAsync(
RequestHeader requestHeader,
string endpointUrl,
StringCollection localeIds,
StringCollection profileUris)
{
return Task.Factory.FromAsync(
(callback, state) => BeginGetEndpoints(requestHeader,
endpointUrl, localeIds, profileUris, callback, state),
result => {
EndpointDescriptionCollection endpoints;
var response = EndGetEndpoints(result, out endpoints);
return endpoints;
},
TaskCreationOptions.DenyChildAttach);
}

/// <summary>
/// Patch returned endpoints urls with url used to reached the endpoint.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Tests/Opc.Ua.Client.Tests/NodeCacheTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public void NodeCacheTestAllMethodsConcurrently()
NodeId number = new NodeId((int)BuiltInType.Number);
bool isKnown = Session.NodeCache.IsKnown(new ExpandedNodeId((int)BuiltInType.Int64));
Assert.True(isKnown);
bool isKnown2 = Session.NodeCache.IsKnown(TestData.DataTypeIds.ScalarValueDataType);
bool isKnown2 = Session.NodeCache.IsKnown(TestData.DataTypeIds.ScalarStructureDataType);
Assert.True(isKnown2);
NodeId nodeId = Session.NodeCache.FindSuperType(TestData.DataTypeIds.Vector);
Assert.AreEqual(DataTypeIds.Structure, nodeId);
Expand All @@ -519,7 +519,7 @@ public void NodeCacheTestAllMethodsConcurrently()
bool isEncodingOf = Session.NodeCache.IsEncodingOf(new ExpandedNodeId((int)BuiltInType.Int32), DataTypeIds.Structure);
Assert.False(isEncodingOf);
bool isEncodingFor = Session.NodeCache.IsEncodingFor(DataTypeIds.Structure,
new TestData.ScalarValueDataType());
new TestData.ScalarStructureDataType());
Assert.True(isEncodingFor);
bool isEncodingFor2 = Session.NodeCache.IsEncodingFor(new NodeId((int)BuiltInType.UInt32), new NodeId((int)BuiltInType.UInteger));
Assert.False(isEncodingFor2);
Expand Down
3 changes: 2 additions & 1 deletion Tests/Opc.Ua.Client.Tests/SubscriptionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ public async Task TransferSubscription(TransferType transferType, bool sendIniti
{
const int kTestSubscriptions = 2;
const int kDelay = 2_000;
const int kQueueSize = 10;

// create test session and subscription
var originSession = await ClientFixture.ConnectAsync(ServerUrl, SecurityPolicies.Basic256Sha256).ConfigureAwait(false);
Expand All @@ -537,7 +538,7 @@ public async Task TransferSubscription(TransferType transferType, bool sendIniti

// set defaults
subscription.DefaultItem.DiscardOldest = true;
subscription.DefaultItem.QueueSize = (ii == 0) ? 0U : 5;
subscription.DefaultItem.QueueSize = (ii == 0) ? 0U : kQueueSize;
subscription.DefaultItem.MonitoringMode = MonitoringMode.Reporting;

// create test set
Expand Down

0 comments on commit 49c8532

Please sign in to comment.