Excel AddIn using Add-In express, VS2010, cometd.net talks to cometd server and Tom cat
In RTDInitialize event handler, I log in Tom Cat and connect to cometd server, I use an instance of class credential to remember it is loggedOn(set IsLoggedOn to true) and sessionID.
In RefreshData handler of topic, I will register to cometd server if not register yet. Then I will subscribe topic to Tom Cat. Now when users delete the RTD function from Excel,
DisconnectData handler is called, in it I disconnect from cometd server, logout from Tom Cat, clear out sessionID.
Next time, when users enter RTD function again, it will call RTDInitialize event handler, login and connect where IsLoggoned set to true and sessionID is updated. The strange thing is after 2nd time login, in refreshData, I check the credentials, IsLogged becomes false and sessionID is empty just like what it was at first logout. Anyone know why? not sure if I make it clear. Thanks
I suppose you have just one topic in your tests. I suppose that you store a reference to the “instance of class credential” on the class level of the RTD server module. And when you delete the topic, the RTD server module is destroyed; this kills the information about previous connection. If you think that I misunderstood the problem, please clarify.