HttpPollingDuplex 的 serverPollTimeout 配置
我正在使用 Silverlight 和 HttpPollingDuplex 编写纸牌游戏。
我有 4 个独立的 http 双工服务,可以从我的游戏(silverlight 客户端)
1 中调用。 ChatService
2. AuthService
3.大堂服务
4. GameService
在 IIS 7.5 下托管游戏后,我用 Fiddler 注意到 Silverlight 客户端按顺序执行轮询请求,并且我的应用程序变成非常慢,因为例如从聊天服务客户端获取消息必须等到其他服务轮询完成。与我更改服务的 serverPollTimeout 以便更快地完成轮询相比,现在我的游戏运行速度更快,但会继续按顺序请求服务。所以问题是
是否可以创建客户端代理或配置客户端在多个轮询服务的情况下并行执行轮询查询?如果不是,在我的情况下更改 serverPollTimeout 是一个好的做法吗?或者什么对我来说是最好的配置?
在单独的线程中创建代理并调用服务方法没有帮助:(
非常感谢!
I am writing card game using Silverlight and HttpPollingDuplex.
I have 4 seperate http duplex services, which can be called from my game (silverlight client)
1. ChatService
2. AuthService
3. LobbyService
4. GameService
After I host the game under IIS 7.5 I note with Fiddler that Silverlight client do polling requests sequentially, and my application become very slow, because for example for getting message from chat service client have to wait until other services polling will be finished. Than I changed serverPollTimeout for services to finish pollings faster, now my game works faster, but do continues requests to services sequentially. so the question is
Is it possible to create client proxy or configure client to do polling queries parallel in case of more than one polling service? and if not is changing serverPollTimeout good practice in my case? or what will be the best configuration for me?
Creating proxy and calling service methods in separate thread doesn't help :(
Thanks a lot!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果有人遇到同样的问题,这是我的练习
Silverlight 在浏览器中可以使用的 HTTP 连接数是有限制的,如果所有服务都位于同一主机://名称:端口上,则应该只有一个轮询连接无论那里托管有多少服务。
我为每个服务创建了子域,这解决了问题
Here is my workout if someone has the same problem
There is a limit to how many HTTP connections Silverlight can use in the browser, If all the services live on the same host://name:port, there should be only one onging polling connection to it, no matter how many services are hosted there.
I created sub domains for each service, which solves the problem
另一个解决方案是将创建的实例设置为静态属性。
Another solutions is set created instance as a static property.