简体   繁体   English

SignalR 集线器对象重置

[英]SignalR Hub Objects Reset

I have some thing like that in my hub class:我的中心课程中有类似的东西:

private static List<message> messages = new List<message>();

the messages list is updating by the way.顺便说一下,消息列表正在更新。 but every 10-15 hours the messages list resets.但每隔 10-15 小时,消息列表就会重置。 so that messages.Count == 0. why it happens ?所以messages.Count == 0. 为什么会发生? should i update the messages stat in database ?我应该更新数据库中的消息统计信息吗?

edit:编辑:

what about objects that handle some thing like player game positions that updates every 0.1sec.处理诸如每 0.1 秒更新一次的玩家游戏位置之类的对象呢? what multiplayer servers do for this issue多人服务器对这个问题做了什么

Static members like that are cleared during an IIS app pool reset.在 IIS 应用程序池重置期间会清除此类静态成员。 This happens (by default) every 12 hours.这种情况(默认情况下)每 12 小时发生一次。

Yes, you should store anything critical in a database.是的,您应该在数据库中存储任何重要的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM