Ways to make two way communications for notification using .NET

风格不统一 提交于 2019-12-07 17:51:52

问题


I have a server/client project, I am using C# for coding, WCF as server. I am limited to HTTP, had no luck with wsdualhttpbinding so far. Project is working on company network.

Is there any way to send notifications from server to client in any way other than WCF duplex? Please tell all options.


回答1:


I am assuming because of firewall issues you have problems with an incoming connection.

In such a scenario a common way to solve the problem is.

  1. Have a separate thread from which you poll the server using the service request A maybe GetNextNotification
  2. This connection should have a high timeout.
  3. On the server side when A is processed the method doesn't return until there is something server wants to convey to the client
  4. Once A returns the client processes the notification and makes another A request.



回答2:


There is solution currently being build over ASP.Net called SignalR. Have a look. I think it uses long polling to achieve the results



来源:https://stackoverflow.com/questions/8116669/ways-to-make-two-way-communications-for-notification-using-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!