插件 Express RTD 刷新问题
Excel AddIn 使用 Add-In Express、VS2010、cometd.net 与 cometd 服务器和 Tom cat 通信 在 RTDInitialize 事件处理程序中,我登录 Tom Cat 并连接到 cometd 服务器,我使用类凭据的实例来记住它已登录(将 IsLoggedOn 设置为 true)和 sessionID。
在主题的 RefreshData 处理程序中,如果尚未注册,我将注册到 cometd 服务器。然后我会订阅汤姆猫的主题。现在,当用户从 Excel 中删除 RTD 函数时, DisconnectData 处理程序被调用,在其中我断开与 cometd 服务器的连接,从 Tom Cat 注销,清除 sessionID。 下次,当用户再次进入 RTD 功能时,它将调用 RTDInitialize 事件处理程序,登录并连接,其中 IsLoggoned 设置为 true,并且更新 sessionID。奇怪的是,第二次登录后,在刷新数据中,我检查凭据,IsLogged 变为 false,并且 sessionID 为空,就像第一次注销时一样。有人知道为什么吗?不确定我是否说清楚了。谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你的测试中只有一个主题。我假设您在 RTD 服务器模块的类级别上存储了对“类凭据实例”的引用。当你删除主题时,RTD服务器模块将被销毁;这会删除有关先前连接的信息。如果您认为我误解了这个问题,请澄清。
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.