Hello again,

consider that the library is able to reconnect and resubscribe automatically. So you should subscribe your table just once, using an internal flag to remember whether the subscription has been done or not. Connection and session events, as long as you accept the automatic reconnection behavior, may happen at any time.

A brief note on the home page of the documentation explains how to avoid the automatic reconnection, that is: by manually closing the connection (better on a separate thread) when a connection failure event occurs. Manually closing the connection also clears the subscription memory, and thus avoids subsequent automatic resubscriptions.

Hope this helps.
Best regards,

Gianluca