简体   繁体   English

WCF RIA服务中的服务器进度

[英]Server Progress in WCF RIA Services

使用耗时的wcf ria服务时,可以从服务器向客户端发送进度更新吗?

Of course you can. 当然可以。 It's not an out of the box solution anyway... All we know that every call that we make from Silverlight is async, so the client continue to respond regardless if there are pending requests. 无论如何,这都不是开箱即用的解决方案...我们都知道,我们从Silverlight进行的每个调用都是异步的,因此无论是否有待处理的请求,客户端都将继续响应。

That said, you can either make use of HttpPollingDuplex and use that sort of callback to notify your client or you can simply poll the server ar regular interval to obtain the current status of the operation. 也就是说,您可以使用HttpPollingDuplex并使用此类回调来通知您的客户端,或者您可以按固定的时间间隔轮询服务器以获取操作的当前状态。

Be aware that the server variable that holds the state should be ideally stored in ASP.NET Session and eventually accessed in a lock block cause you are writing it from a thread and reading it from another one 请注意,保存状态的服务器变量应该理想地存储在ASP.NET会话中,并最终在块中访问,因为您是从线程中编写它并从另一个线程中读取它

Hope this helps 希望这可以帮助

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

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