Skip to content
Discussion options

You must be logged in to vote

No, you don't need RemoveSubscription before closing. It sends a DeleteSubscriptions request to the server, so it fails with an exception as soon as the connection is gone, which is exactly what you saw.

Close() already covers it. It sends CloseSession with deleteSubscriptions = session.DeleteSubscriptionsOnClose (default true), so the server deletes the subscriptions together with the session. Communication errors during close are logged and returned as a status code instead of thrown. Dispose() then releases the local subscription and monitored item objects. If the server is unreachable, it cleans up the orphaned subscriptions itself when the session times out.

A safe shutdown is theref…

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
question The issue contains a question. After no activity the issue might be closed. needs investigation
2 participants
Converted from issue

This discussion was converted from issue #1777 on December 03, 2025 05:36.