如何使用 PollingDuplexHttpBinding 处理客户端断开连接
我正在使用 Silverlight 3 客户端实现 WCF 服务,该客户端使用 PollingDuplexHttpBinding 进行通信。当客户端关闭浏览器而不先与服务器断开连接时,有哪些替代处理方法?
我知道它最终会抛出一个 TimeoutException,我可以捕获它,但是有没有更好的方法来检测这个问题?
谢谢。
I am implementing a WCF service, with a Silverlight 3 client, which uses a PollingDuplexHttpBinding for communications. What are the alternatives for handling when a client closes their browser without disconnecting from the server first?
I know that it will eventually throw a TimeoutException, which I can catch, but is there a better way of detecting this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您会想要这样的东西:
通道还公开了一个Faulted事件,但随后立即抛出了Closed事件。
You'll want something like this:
The channel also exposes a Faulted event, but the Closed event is thrown immediately afterwards.