BrowseNext
When the number of child nodes exceeds the server's single-page limit, the response will include a non-empty ContinuationPoint (paging token). Only BrowseWithPaging I'll leave it to you; use BrowseNext to go to the next page.
Prerequisite Reading
- To get it, you must ContinuationPoint use BrowseWithPaging, Regular Browse Will be discarded CP.
Signature
public BrowsePage BrowseNext(byte[] continuationPoint, bool release = false);
| Parameters | Note |
|---|---|
| continuationPoint | Last Browse/ BrowseNext returned continuation token |
| release | true = Abort further paging; the server releases resources (no references are returned) |
BrowsePage Field
public sealed class BrowsePage
{
public IReadOnlyList<OpcUaReference> References { get; init; }
public byte[] ContinuationPoint { get; init; } // "null" indicates that there are no more pages
}
Complete Page-Turning Example
var page = ua.BrowseWithPaging("ns=2;s=BigFolder");
var allRefs = new List<OpcUaReference>(page.References);
while (page.ContinuationPoint != null)
{
page = ua.BrowseNext(page.ContinuationPoint);
allRefs.AddRange(page.References);
}
Console.WriteLine($"Total {allRefs.Count} children");
Proactive Release (Saves Server Resources)
The server maintains ContinuationPoint a state for each one, which consumes resources. If you decide to stop browsing partway through, call the method to explicitly release=true release it:
ua.BrowseNext(page.ContinuationPoint, release: true);
If it is not explicitly released, the server must wait for it to be reclaimed according to the session policy (the timing of reclamation is determined by the server and is SDK not guaranteed).
Note
ContinuationPointis an opaque byte array, Do not modify / parse / concatenate- For turning pagesThe most recent return of
ContinuationPointContinue — You'llBrowseNextget a new one every time; don't go flipping through the old ones anymore. - Session points are resources maintained by the server on a per-session basis. Once you receive them, use them up as soon as possible; don't hoard them and leave them unused for a long time.