Skip to content
Discussion options

You must be logged in to vote

You are right, it can happen. The lock in Client_ReconnectComplete only makes the swap itself consistent with the keep-alive handler. Code in ClientSamples/Program that reads uaClient.Session without synchronization can still hold the old reference while it is disposed. The sample keeps it simple on purpose and does not show a production-grade pattern.

In practice the window is small: the handler only swaps to a new session after reactivating the old one failed, so calls on the old session fail anyway at that point (BadSessionClosed, BadNotConnected, BadSecureChannelClosed, or ObjectDisposedException if it is already disposed). With a raw Session plus SessionReconnectHandler, the applicat…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by romanett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants