Question about releaseContinuationPoint of browseNext

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
dingy
Sr. Member
Sr. Member
Posts: 14
Joined: 28 May 2013, 03:15

Question about releaseContinuationPoint of browseNext

Post by dingy »

Hello, support team:

To browse a node with large number of references, I make a combined usage of browse and browseNext method of UaClient, and the pseudo-code is as following:

ret = client.browse(nodeid, maxReferenceNumber, continuationPoint, referenceDescription);

while (ret.isGood() && OpcUa_False == continuationPoint.isEmpty())
{
OpcUa_Boolean doNotReleaseContinuationPoint = OpcUa_False;
ret = browseNext(doNotReleaseContinuationPoint, continuationPoint, referenceDescription);
}

My question is that does the continuationPoint managed in the server session will be released when the browse is finished?

And do I need to call browseNext( releaseContinuationPoint, ...) explicitly to release it?

Thanks

User avatar
Support Team
Hero Member
Hero Member
Posts: 3071
Joined: 18 Mar 2011, 15:09

Re: Question about releaseContinuationPoint of browseNext

Post by Support Team »

Hello dingy,

there seems to be a misunderstanding about the function of BrowseNext. The "release" of a continuation point indicates in the server that it can clean up the continuation because the client has no interest in any more browse results.

So, whenever a ContinuationPoint is returned, the Client must either:
1) call BrowseNext using the CP (release==false), the response on this BrowseNext can again contain a new CP
2) call BrowseNext (release==true), abort the browsing at this point, no more results, server can clean up
3) close the session, by this implicitely all CPs will be released.

Best Regards
Support Team

dingy
Sr. Member
Sr. Member
Posts: 14
Joined: 28 May 2013, 03:15

Re: Question about releaseContinuationPoint of browseNext

Post by dingy »

Hello,

I understand that the CP inside the server will be released as you describe in case 2:
2) call BrowseNext (release==true), abort the browsing at this point, no more results, server can clean up

But my question focus on case 1:
1) call BrowseNext using the CP (release==false), the response on this BrowseNext can again contain a new CP

In fact, when I execute repeatedly BrowseNext with release=false , the BrowseNext will return a non-empty CP if there are more references to browse.

In case that no more references to return, an empty CP will be returned which means the end of BrowseNext.

And my question is, after the end of BrowseNext, is it necessary to do a cleaning job(ReleaseContinuationPoint = true) explicitly?

I got this question, because in uaserver_browse.c, I find that the CP is only released when ReleaseContinuationPoints == OpcUa_True. In other word, if I call BrowseNext(release == false) until the end of BrowseNext, the CP is not released yet.


In function UaServer_BeginBrowseNext:
if (pRequest->ReleaseContinuationPoints == OpcUa_False)
{
.....
} else {
......
// The UaServer_TurboList_Remove is called only in case ReleaseContinuationPoints == OpcUa_True
UaServer_TurboList_Remove(pContinuationPoints, j);
}


Thanks

User avatar
Support Team
Hero Member
Hero Member
Posts: 3071
Joined: 18 Mar 2011, 15:09

Re: Question about releaseContinuationPoint of browseNext

Post by Support Team »

Hello Dingy,

in case 1) you call BrowseNext until you receive an empty CP (meaning that there are no more elements to browse). The server already knows that the browse is done completely and can clean up (if he needs that) by himself. The Client does not need to call BrowseNext (release==true) again, that is not required.

You can be sure that the server is fine and not leaking anything in this situation.

Best Regards
Support Team

dingy
Sr. Member
Sr. Member
Posts: 14
Joined: 28 May 2013, 03:15

Re: Question about releaseContinuationPoint of browseNext

Post by dingy »

Thanks for your response. And wishing you a very merry Christmas.

Post Reply