简体   繁体   English

WCF多会话wsdualhttpbinding重新连接到服务器

[英]WCF multi-session wsdualhttpbinding reconnect to server

I implemented a WCF service that will do some long task. 我实现了WCF服务,该服务将完成一些长期任务。 It needs to provide client with notifications about current progress of that long task. 它需要向客户提供有关该长任务当前进度的通知。 It is working well so far, but the problem is: 到目前为止,它运行良好,但问题是:

When user closes the client app, and then open it again, client app should start receiving updates from server again about the task that is running. 当用户关闭客户端应用程序,然后再次打开它时,客户端应用程序应重新开始从服务器接收有关正在运行的任务的更新。

There can be multiple tasks started by different users at the same time. 不同的用户可以同时启动多个任务。 So for example, client starts a process named "proc1" that will be 3 hours long, and after 15 minutes he closes the app. 因此,例如,客户端启动了一个名为“ proc1”的进程,该进程将持续3个小时,然后在15分钟后关闭该应用程序。 The process continues to work on server. 该过程在服务器上继续进行。 After 30 minutes client starts the app again and then client app needs to start getting notifications about the process client has started 30 minutes ago. 30分钟后,客户端将再次启动该应用程序,然后客户端应用程序需要开始获取有关客户端30分钟前已启动的进程的通知。 How can this be accomplished? 如何做到这一点?

Thanks in advance. 提前致谢。

You should save on client side some process id that can be used later to get progress of that process. 您应该在客户端保存一些进程ID,以便以后获取该进程的进度。 Try using that process id to reconnect to the notifications. 尝试使用该进程ID重新连接到通知。

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

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