Ways to make two way communications for notificati

2019-05-10 16:25发布

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.

2条回答
干净又极端
2楼-- · 2019-05-10 17:06

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.
查看更多
三岁会撩人
3楼-- · 2019-05-10 17:07

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

查看更多
登录 后发表回答